rails 4, simple form, "information" controller

1 view
Skip to first unread message

Jamie Orchard-Hays

unread,
Mar 12, 2014, 12:42:19 PM3/12/14
to CVR...@googlegroups.com, RubyJam
Hey all:

I've got a simple rails app for collecting information. I have a section called "Vendor Information" with VendorInformationController. Since we don't use the word "informations" I have not used the "s"-appended form of the word for the controller or routes. This works mostly fine except with Simple Form which generates "vendor_informations_path" instead of "vendor_information_path".

routes.rb:
resources :vendor_information

the form:
simple_form_for @vendor_information do ....

rendering the form:
undefined method `vendor_informations_path' for #<#<Class:0x007ff5252dff88>:0x007ff5253a7ad8>

I haven't found the proper foo or workaround for this and am about to just give up and have the stupid "VendorInformation*s*Controller" name.

Ideas?

Jamie

Mel Riffe

unread,
Mar 12, 2014, 12:51:47 PM3/12/14
to rub...@googlegroups.com, CVR...@googlegroups.com
Have you tried:

resource :vendor_information

resources :vendor_information, controller: 'VendorInformation'

--Mel




Jamie

--
You received this message because you are subscribed to the Google Groups "Ruby Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyjam+u...@googlegroups.com.
To post to this group, send email to rub...@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyjam.
For more options, visit https://groups.google.com/d/optout.

Jamie Orchard-Hays

unread,
Mar 12, 2014, 1:38:58 PM3/12/14
to cvr...@googlegroups.com, rub...@googlegroups.com
It seems to be more a problem with Simple Form or Rails' Form underneath it than the routes, which are generating the correct helpers.


You received this message because you are subscribed to the Google Groups "Central Virginia Ruby Enthusiasts Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cvruby+un...@googlegroups.com.
To post to this group, send email to cvr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cvruby.

Mel Riffe

unread,
Mar 12, 2014, 1:45:04 PM3/12/14
to rub...@googlegroups.com, cvr...@googlegroups.com
Well, that stinks. I guessed that Simple Form was using the generated routes when constructing the form. Guess I was wrong.

Jamie Orchard-Hays

unread,
Mar 12, 2014, 1:45:44 PM3/12/14
to cvr...@googlegroups.com, rub...@googlegroups.com
Looking at the generated routes I see that I can do this, which works:

simple_form_for @vendor_information, :url => vendor_information_index_path do...

It posts to that which goes to create action. 

Mel Riffe

unread,
Mar 12, 2014, 3:16:02 PM3/12/14
to cvr...@googlegroups.com, rub...@googlegroups.com
Ouch! Good find Paul; thanks for sharing...


On Wed, Mar 12, 2014 at 2:17 PM, paul damer <pda...@gmail.com> wrote:
Looks like this is a long standing bug in rails.

https://github.com/rails/rails/issues/1769

Reply all
Reply to author
Forward
0 new messages