Ruby on Rails Sunday, March 31, 2019

I can create a new record from the model on the right side of a has_many statement Why user the model on the left plus . plus the model on the right plus build The reason I'm asking is because I came across this piece of code below As you can see it's a little primitive placing the seller's name in the auction model instead of leaving it alone and rendering in views from the records in User I'm gonna remove seller_name from the table

   @auction = current_user.auctions.build(params[:auction])
    @auction.seller_name = current_user.name

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/83cebab4-47be-407e-b12b-298cc06459cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Saturday, March 30, 2019

I'm trying to contribute to several open source projects, but I'm unable to get them working on my local machine.  Fortunately, these open source projects use Travis CI.  Unfortunately, I don't know how to replicate the Travis CI environment on my local machine, even with the use of Docker images I've created myself, which don't really replicate the setup.

Are the Docker images used by Travis CI publicly available?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6b47d390-97a7-470c-86da-e0a74e0ee45c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Friday, March 29, 2019

If your production server is serving JQuery make sure it's the correct version on that server. If source is from somewhere else make sure the Production server's code has the correct URL and double check your load order for all JS assets. 

On Fri, Mar 29, 2019 at 3:31 PM Joe Guerra <JGuerra@jginfosys.com> wrote:
I ran console.log(jQuery.fn.jquery);
(which checked the jquery version in the browsers console) and 3.3.1 on the development, 1.12.4 on the production. I would imagine that's what's wrong, now why?



On Friday, March 29, 2019 at 4:04:01 PM UTC-4, Joe Guerra wrote:
ok, well I guess JQuery is not running on my production site, but seems to load and run locally...


On Friday, March 29, 2019 at 3:56:29 PM UTC-4, Joe Guerra wrote:
I got this dropdown hover script working on my local pc, unfortunately when push it to github and build it on heroku it doesn't work :(

It's not a big deal, but it seems odd that's all.    I'll be replacing ckeditor with a nice jquery wysiwyg editor (so hoping that works too).

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4483f5b0-1ca3-4394-bf81-c280a7d5cd8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Brandon McClelland
User Support Technician
Steve Jackson Games

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADuEqHKiEH_ZCgCKgNd1JRGOeLdjZE6FwgVNG2SfZA_SjtfBvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I ran console.log(jQuery.fn.jquery);
(which checked the jquery version in the browsers console) and 3.3.1 on the development, 1.12.4 on the production. I would imagine that's what's wrong, now why?



On Friday, March 29, 2019 at 4:04:01 PM UTC-4, Joe Guerra wrote:
ok, well I guess JQuery is not running on my production site, but seems to load and run locally...


On Friday, March 29, 2019 at 3:56:29 PM UTC-4, Joe Guerra wrote:
I got this dropdown hover script working on my local pc, unfortunately when push it to github and build it on heroku it doesn't work :(

It's not a big deal, but it seems odd that's all.    I'll be replacing ckeditor with a nice jquery wysiwyg editor (so hoping that works too).

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4483f5b0-1ca3-4394-bf81-c280a7d5cd8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

ok, well I guess JQuery is not running on my production site, but seems to load and run locally...


On Friday, March 29, 2019 at 3:56:29 PM UTC-4, Joe Guerra wrote:
I got this dropdown hover script working on my local pc, unfortunately when push it to github and build it on heroku it doesn't work :(

It's not a big deal, but it seems odd that's all.    I'll be replacing ckeditor with a nice jquery wysiwyg editor (so hoping that works too).

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/864f76ee-b76b-4ff5-8c02-c2ec9628279e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Not quite sure what you're asking.

Rails by default has no root path configured. You have to add that in
yourself. You can have non-root paths too.

If you see a Rails app where the root path seems to work but there
isn't one defined it could be being proxied there by the webserver.

On Fri, Mar 29, 2019 at 3:40 PM fugee ohu <fugee279@gmail.com> wrote:
>
> I came across an app with no root path How does it work?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ee73753f-cde1-4aa5-aa3d-54ce68610f73%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ6MPzLa9YKmO3gxbNNREP8%2BNU2cQQ5qFCzzSSWQ1wY7cRBhoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I came across an app with no root path How does it work?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ee73753f-cde1-4aa5-aa3d-54ce68610f73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Thursday, March 28, 2019

Thank you! I was having a similar problem and it was the storage.yml file having issues. This post helped point me in that direction and track down the problem. (My :amazon section of the storage.yml wasn't set up correctly, and the storage.yml wasn't valid .yml). 

Best wishes,

Kody

On Tuesday, June 12, 2018 at 12:04:36 PM UTC-6, Skt Hg wrote:
Replying to myself in case someone hits the same issue.

First thanks Frank for the pointers you sent me. I am new to rails so it was very helpful to debug from a clean state.

I got to solve it, the main issue for me was a parsing error in the 'storage.yml' file. The storage engine was chocking on it, even if the file was passing several linters fine.
I kept the original file for later review, but rewriting it from scratch solved the issue.

Best

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/042d069e-cb20-45c1-ad45-9d566b28a8c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Does Rails 6 support multiple databases with different database schemas?

Rails 6 introduced support for multiple databases with this PR https://github.com/rails/rails/pull/34052
From my understanding the API designed by DHH https://github.com/rails/rails/pull/33877#issuecomment-421226095 seem to suggest that `animals` and `machines` have different structures however when I create an app with the database config as described there, when migrating, the same database structure from `base` gets copied in animals_structure.sql and machines_structure.sql .

I want to know if it's possible to have 2 databases with different structure as below

base_schema.rb
ActiveRecord::Schema.define(version: 2019) do
  create_table "create_users" do |t|
    t.string "name"
  end
end

animals_schema.rb
ActiveRecord::Schema.define(version: 2019) do
  create_table "create_dogs" do |t|
    t.string "fur_color"
  end
end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a788e34d-2959-4111-afa1-868f1ebd3f7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

scope :ending, -> { limit(4) }

On Thu, Mar 28, 2019 at 4:52 AM fugee ohu <fugee279@gmail.com> wrote:
>
> How would I correct this scope statement from my model for rails 5.1.4
> scope :ending, :limit => 4
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/91dc6590-2ad6-4b75-836e-c4a4e69701ea%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ6MPz%2BWeTm3PXWMmG9QSGT6xbsBV-uatc2%2BasJx5qk2T-3L6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

How would I correct this scope statement from my model for rails 5.1.4
scope :ending, :limit => 4

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/91dc6590-2ad6-4b75-836e-c4a4e69701ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks for the links - that clears it up.

The reason for using a migration and not seed data, is that this is real data needed in our production db, and I use seeds.rb to populate my development db with data to test with.

onsdag den 27. marts 2019 kl. 22.33.42 UTC+1 skrev Eito Katagiri:
You need to call .reset_column_information in third migration. Please refer 

You can insert and update data in migration, but you might want to consider using db/seeds.rb instead. 

HTH

2019年3月27日(水) 23:36 <t...@stinto.com>:
I'm running Rails 5.0.6, and I can't Google myself to any other occurences of this problem.

The migrations fail when I have a migration that inserts data into a table, that has data for a column that was added in a previous migration file executed by the same migrate command 

Basically I have 3 migrations that are run with the following command
rails db:migrate


first migration chronologically: 

create_table :campaign_orders do |t|
  t
.integer :order
end


second migration:

add_column :campaign_orders, :priority, :integer


third migration:

CampaignOrder.create(order: 0, priority: 1)


The third migration fails, if all migrations are outstanding when running migrate command, but succeeds if you run the migrate command again.  It fails with the following error:
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
unknown attribute 'priority' for CampaignOrder.
/Users/tomwilliams/Projects/incard-rails/db/migrate/20190326143614_insert_accepted_email_campaign.rb:66:in `up'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `require'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `<top (required)>'
/Users/tomwilliams/Projects/incard-rails/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
ActiveModel::UnknownAttributeError: unknown attribute 'priority' for CampaignOrder.
/Users/tomwilliams/Projects/incard-rails/db/migrate/20190326143614_insert_accepted_email_campaign.rb:66:in `up'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `require'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `<top (required)>'
/Users/tomwilliams/Projects/incard-rails/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Now, I can just "fix" it by running the migrate command again, or as I did, rollback the migrations and put the added column in the create table migration and deleting the add_column migration.

My question is - does anybody know if this is a known issue, and if so, could someone provide a link.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1eb04bc6-7c56-4555-a90e-47b18a2f8d60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8ac451f6-3513-49a0-b7ed-93034b46a582%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, March 27, 2019

Hi everyone,

I am happy to announce that Rails 5.2.3 has been released.


## CHANGES since 5.2.2

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:


*Full listing*

To see the full list of changes, [check out all the commits on

## SHA-256

If you'd like to verify that your gem is the same as the one I've uploaded,
please use these SHA-256 hashes.

Here are the checksums for 5.2.3:

```
$ shasum -a 256 *-5.2.3.gem
755e335b8b064592717157057a647ba1c4d519be2a912f11c3993e8d5c4e8d13  actioncable-5.2.3.gem
8a6fbf3f52243cdc194c289a417856355899bcc99ec2868300a2b26f40f58a96  actionmailer-5.2.3.gem
81830a59e18d7570386a01bb332538ddf0926b5ed7566646ef608a78825751e8  actionpack-5.2.3.gem
9064ef94411d98cf7c7cc0fb179319b92a880f51f8e0671cceaf8081dccb89ec  actionview-5.2.3.gem
faa055b4986b0d3183ebd8169d82ef491dc947e075e777af2f91ead557fc719f  activejob-5.2.3.gem
d04c4367fd41a2d8767be08e9caadc617e6f825025079854562100145b82f055  activemodel-5.2.3.gem
fc6ef79f341d32b5690a7cb5a26245c33c3d2e4a7c99bb7d1c0089549c19c034  activerecord-5.2.3.gem
80cde4c4990c4220b78c24c50f1a6db7d4a954cc36158c0104c283804145205c  activestorage-5.2.3.gem
2856b0036869e89043f5c870a1a99d2c811785130fea4affad83cf971db91b84  activesupport-5.2.3.gem
f9b51b66a91d556d63d36d04449ecc23867683f99531db21eb7a263be2d7ecdc  rails-5.2.3.gem
042388decffb47dab796e4ddb30a2d615047d7c334de7fe47208545e1677c9be  railties-5.2.3.gem
```

As always, huge thanks to the many contributors who helped with this release.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAC9YFzdKJaY-MF7ZuFQB-bAHFw8D35-4%2Bp6wyBS%3D-TrUC6ZBWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi everyone,

I am happy to announce that Rails 5.1.7 has been released.


## CHANGES since 5.1.6

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:


*Full listing*

To see the full list of changes, [check out all the commits on

## SHA-256

If you'd like to verify that your gem is the same as the one I've uploaded,
please use these SHA-256 hashes.

Here are the checksums for 5.1.7:

```
$ shasum -a 256 *-5.1.7.gem
c344a1b4edd4108b93b341343106e73466d8bbf0a79c926a62c74f6b22984ec1  actioncable-5.1.7.gem
f053e043f0e83b7758b56af7fe21aa3ab2f61787e2edc6a1198acc8d3645fbbe  actionmailer-5.1.7.gem
a2406a8346f95294ad9342c1535e2cc4f04e7c084e71359bae224650581bd17f  actionpack-5.1.7.gem
871ca9cae0524e937543510104555c1e8d87f180b14ce0a03fe62c69012a5244  actionview-5.1.7.gem
f44a4691d7fca6b0f08c2dbd5c81110f428d5c8ade9c6a6b8e09c7984741a55c  activejob-5.1.7.gem
709bb03d9c950353e8f70e0ed4f12154c346d492e5bf6ea53b515413c740fc1e  activemodel-5.1.7.gem
5a1f4bf7b5e5c05a3e21e9207f1336eab026b3dfd794a37eeee4a4c81cfe8544  activerecord-5.1.7.gem
216db77f40e41dab82328321c375f519de8c898dcc2b88a5319d3608928fd07e  activesupport-5.1.7.gem
8d7f527c446de3f99ec506e6a680c42c38979a44b37beb15f7d451a33e74dcf5  rails-5.1.7.gem
c874ebb682f628cfe075c3b9762d3b2ff1a04585c25a2f4eb3840c4b29d73e72  railties-5.1.7.gem
```

As always, huge thanks to the many contributors who helped with this release.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAC9YFzdMTgD2LCzK9dB5M2DLC3qTsAkw5VoqhSiPu%3D244kaJ9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Any chance you'd consider someone working remotely that's willing to travel to Medellin from time to time?  I speak decent enough Spanish and English is my first language.



On Saturday, March 9, 2019 at 5:03:46 AM UTC-6, Michael C. Bertoni wrote:
Hello Ruby on Rails Community!

My name is Michael Bertoni and I'm the SVP-Business Development with Source Meridian. I wanted to see if I could get your help to share this job with your community and network as I have two great full-time RoR positions located in Medellín, Rionegro or Cali Colombia.

Also - If you are aware of any Rails Meetups or Slack Channels, besides "Bogata Ruby Meetup" in South America that would be great. I'm thinking there might be a list somewhere...

Source Meridian is one of the fastest growing companies in the Colombia region and is an engineering and development focused services organization providing customers with early access to cutting edge technology, and helping them to create and maintain their competitive advantage in the marketplace. We have two offices in the United States and three offices in Latin America. Our offices are located in Philadelphia (US), Fort Myers (US), Medellín (CO), Rionegro (CO) and Cali (CO).

We have a tremendous opportunity for a Full-time Senior Ruby on Rails Engineer to work directly with an our HealthTech client. The job is located in Colombia, where you can work from our offices in Medellín, Rionegro or Cali. We offer great compensation, benefits, relocation package for "A" candidates. 

Here's the job below where you review, apply or refer the position to someone in your network.

Job Overview - http://smrtr.io/_vXx

Michael C. Bertoni - SVP-Business Development - Source Meridian
michael...@sourcemeridian.com - 215.817.3295

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c5840e24-e6fa-4d4a-9904-1dbe14daea68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

You need to call .reset_column_information in third migration. Please refer 

You can insert and update data in migration, but you might want to consider using db/seeds.rb instead. 

HTH

2019年3月27日(水) 23:36 <tw@stinto.com>:
I'm running Rails 5.0.6, and I can't Google myself to any other occurences of this problem.

The migrations fail when I have a migration that inserts data into a table, that has data for a column that was added in a previous migration file executed by the same migrate command 

Basically I have 3 migrations that are run with the following command
rails db:migrate


first migration chronologically: 

create_table :campaign_orders do |t|
  t
.integer :order
end


second migration:

add_column :campaign_orders, :priority, :integer


third migration:

CampaignOrder.create(order: 0, priority: 1)


The third migration fails, if all migrations are outstanding when running migrate command, but succeeds if you run the migrate command again.  It fails with the following error:
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
unknown attribute 'priority' for CampaignOrder.
/Users/tomwilliams/Projects/incard-rails/db/migrate/20190326143614_insert_accepted_email_campaign.rb:66:in `up'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `require'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `<top (required)>'
/Users/tomwilliams/Projects/incard-rails/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
ActiveModel::UnknownAttributeError: unknown attribute 'priority' for CampaignOrder.
/Users/tomwilliams/Projects/incard-rails/db/migrate/20190326143614_insert_accepted_email_campaign.rb:66:in `up'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `require'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `<top (required)>'
/Users/tomwilliams/Projects/incard-rails/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Now, I can just "fix" it by running the migrate command again, or as I did, rollback the migrations and put the added column in the create table migration and deleting the add_column migration.

My question is - does anybody know if this is a known issue, and if so, could someone provide a link.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1eb04bc6-7c56-4555-a90e-47b18a2f8d60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfENYVPaY3Q-EAJEVB96M%2B9tfGAEDE6NJaOQrtzK9g6chmCWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

it doesn't crash, but it's not showing up either.   

maybe there is some other plugin I can use.

On Wednesday, March 27, 2019 at 4:08:55 PM UTC-4, Joe Guerra wrote:
hmm, I don't know why it was working before, but I got it working now.

before I was using...

//= require ckeditor/init

[but I didn't have a file in the subfolder ckeditor/init  it was config.js ]

made the correction to ->

//= require ckeditor/config




On Wednesday, March 27, 2019 at 3:30:14 PM UTC-4, Joe Guerra wrote:
Can't seem to build my app in heroku, had no problems with it before...    Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Sprockets::FileNotFound: couldn't find file 'ckeditor/init' with type 'application/javascript'

I'll keep googling and try to figure out what's going on.
Any ideas are welcomed.
Thanks.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/94594e0a-26f0-4b41-a6fe-7e273a248134%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

hmm, I don't know why it was working before, but I got it working now.

before I was using...

//= require ckeditor/init

[but I didn't have a file in the subfolder ckeditor/init  it was config.js ]

made the correction to ->

//= require ckeditor/config




On Wednesday, March 27, 2019 at 3:30:14 PM UTC-4, Joe Guerra wrote:
Can't seem to build my app in heroku, had no problems with it before...    Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Sprockets::FileNotFound: couldn't find file 'ckeditor/init' with type 'application/javascript'

I'll keep googling and try to figure out what's going on.
Any ideas are welcomed.
Thanks.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5d36414e-f0b8-4e44-9846-ac6096ae14b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm running Rails 5.0.6, and I can't Google myself to any other occurences of this problem.

The migrations fail when I have a migration that inserts data into a table, that has data for a column that was added in a previous migration file executed by the same migrate command 

Basically I have 3 migrations that are run with the following command
rails db:migrate


first migration chronologically: 

create_table :campaign_orders do |t|
  t
.integer :order
end


second migration:

add_column :campaign_orders, :priority, :integer


third migration:

CampaignOrder.create(order: 0, priority: 1)


The third migration fails, if all migrations are outstanding when running migrate command, but succeeds if you run the migrate command again.  It fails with the following error:
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
unknown attribute 'priority' for CampaignOrder.
/Users/tomwilliams/Projects/incard-rails/db/migrate/20190326143614_insert_accepted_email_campaign.rb:66:in `up'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `require'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `<top (required)>'
/Users/tomwilliams/Projects/incard-rails/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
ActiveModel::UnknownAttributeError: unknown attribute 'priority' for CampaignOrder.
/Users/tomwilliams/Projects/incard-rails/db/migrate/20190326143614_insert_accepted_email_campaign.rb:66:in `up'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `require'
/Users/tomwilliams/Projects/incard-rails/bin/rails:9:in `<top (required)>'
/Users/tomwilliams/Projects/incard-rails/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Now, I can just "fix" it by running the migrate command again, or as I did, rollback the migrations and put the added column in the create table migration and deleting the add_column migration.

My question is - does anybody know if this is a known issue, and if so, could someone provide a link.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1eb04bc6-7c56-4555-a90e-47b18a2f8d60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello all,

I am trying to decrypt a string which has been encrypted in my rails project. This is how I am encrypting the data:

def encrypt_text(text_To_encrypt)
        # Ref: http://www.monkeyandcrow.com/blog/reading_rails_how_does_message_encryptor_work/
        secret
= Rails.configuration.miscconfig['encryption_key']
        salt
= Rails.configuration.miscconfig['encryption_salt']
        key
= ActiveSupport::KeyGenerator.new(secret).generate_key(salt, 32)
        crypt
= ActiveSupport::MessageEncryptor.new(key)
        encrypted_data
= crypt.encrypt_and_sign(text_To_encrypt)
        encrypted_data
end

I am able to decrypt using decrypt_and_verify, but I want to decrypt it manually using openssl. How do I do that. I tried doing the following command:

echo "<encrypted_message>"|openssl enc -d -aes-256-cbc -a -salt
This encrypted message is the first part of the "encrypted_data" from the above code. This doesn't include the IV. It didn't work, so I tried giving the entire encrypted_data, which didn't work as well. After giving the password, it shows "bad magic number". I don't understand what I am doing wrong. Can someone please give me a push in the right direction.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/81f2a556-4d47-404d-a057-04174a8c15ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Tuesday, March 26, 2019

Thanks guys, for your help.But i seems to fix the problem anyway. didn't know why, i wraped the contact#new in a html form element. I removed it and it worked

On Thu, Mar 21, 2019, 7:32 PM Rob Zolkos <rob@zolkos.com wrote:
Looks like you are not redirecting the user to another page when the contact info has been sent.

Do you want to redirect them to the home (or another) page and show a "Your message has been sent" alert?   

replace flash.now[:error] = nil with redirect_to root_path, notice: 'Your message has been sent!'

On Thu, Mar 21, 2019 at 10:05 AM Don Bottles <alg70021@gmail.com> wrote:
My rails app display the authenticity token in the browser url, when i click on send in my contact form, how do i make it not shown?? 

Rails 5.1
ruby 2.3

routes.rb
Rails.application.routes.draw do
    resources :homepage
    root 'homepage#index'

    resources :contacts, only: [:new, :create]
end


Contacts controller
contacts.rb

class ContactsController < ApplicationController
    def new
        @contact = Contact.new
    end

    def create
        @contact = Contact.new(params[:contact])
        @contact.request = request
        if @contact.deliver
            flash.now[:error] = nil
        else
            flash.now[:error] = "Error, couldn't send Message."
            render :new
            end
    end
end




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJvOKtEeD%2Bn0JNXuwkU9XzP6gyXUs2KxyyzyTTdmWZopb7jueQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ6MPz%2BacWb5ivioWN1ocuN_F2wR%2BL%2BG0Tf7iG5U8cf9XKr_rA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJvOKtFAY8Qpi8x5qA3HrX2%3DChxXBQxHHEPjZqz%2B%2B2XpxK214g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Monday, March 25, 2019

> On Mar 25, 2019, at 7:37 AM, Piyush Chowhan <peyushchowhan7@gmail.com> wrote:
>
> Hi,
>
>
> <td><%= f.check_box :tax_rates, :name => "tax_group[tax_rates][]", :value => tax_rate.id %>
>
> I want to fetch tax_rate.id to other table which is selected in the check box?
>
> The check box which is selected those id's I want to fetch in other table inside a parameter in array.
>
> Multiple check box's are selected want those selected check box id's in to array in the other table of params

Can you say a little more about your problem? It's not clear from the explanation above exactly what you're trying to do. Are you trying to get the values from the array of check boxes in a controller, and assign them to a different set of parameters?

Are you trying to do something in the page itself (maybe with JavaScript) to cause one set of check boxes to act on a different set of check boxes in the same page?

What do your parameters look like (in the development console) when you submit this form?

Walter

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/404B3A61-FE90-4FFD-8FBA-301B8ECE09A2%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi,


<td><%= f.check_box :tax_rates, :name => "tax_group[tax_rates][]", :value => tax_rate.id  %>

I want to fetch tax_rate.id to other table which is selected in the check box? 

The check box which is selected those id's I want to fetch in other table inside a parameter in array.

Multiple check box's are selected want those selected check box id's in to array in the other table of params

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5c644978-92b1-4058-84ba-8cbbd276770e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


On Mon, Mar 25, 2019 at 4:46 PM Sapna Mishra <sapna.spaceo@gmail.com> wrote:
Yes I did. I have find the repo for this in github. https://github.com/max-power/iban/
in that they have mentioned that this repo is moved to https://github.com/max-power/bank so I have used that now and it is working. Thanks


imho, the origl repo should be emptied and, if the link/repo should stay for whatever reason, should provide a redirect instead.

--
many thanks and many regards,
--botp

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAAwHHQjqb0yJZxcmw9BLe0gJ%2BEhm8caT8Wb9NQMpwHUdrdU_gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Yes I did. I have find the repo for this in github. https://github.com/max-power/iban/
in that they have mentioned that this repo is moved to https://github.com/max-power/bank so I have used that now and it is working. Thanks

On Monday, March 25, 2019 at 2:13:21 PM UTC+5:30, Colin Law wrote:
On Mon, 25 Mar 2019 at 07:12, Sapna Mishra <sapna....@gmail.com> wrote:
>
> I have installed IBAN gem to my application.
>
> gem 'IBAN'
>

Did you run bundle install after that?

Colin

>
> I have created one validator class for this.
>
> require 'IBAN'
> class IbanValidator < ActiveModel::Validator
>   def self.validate(iban_no)
>     return IBAN.valid?(iban_no)
>   end
> end
>
> but it gives me this error
>
> cannot load such file -- IBAN
>
>
> when I call the method without require I get below error
>
> uninitialized constant IbanValidator::IBAN
>
>
> I am not sure why I am not able to access IBAN to my application.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ec34d48a-ecd4-4be5-b8f9-481394dbc093%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6bef3c4c-efb9-48bf-8978-a0bbf002f584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.