Hwo to get simpel_form to work with a singelton resource?

156 views
Skip to first unread message

thilo

unread,
Nov 8, 2011, 5:42:39 PM11/8/11
to plataformate...@googlegroups.com
Am I missing something to get simpel_form to work with a singelton resource.

Is uses the wrong path when i use it like 'simple_form_for @singelton_resource do ...'

Thanks for the help.

Thilo

Carlos Antonio da Silva

unread,
Nov 8, 2011, 5:46:04 PM11/8/11
to plataformate...@googlegroups.com
This is how Rails works, for singleton resources (which have routes in singular) you have to give the :url option with the right url. There is no way for Rails to detect whether this is a singleton resource to generate the routes in singular, it just uses the "normal" as default.
--
At.
Carlos Antonio

Olawale Alabi

unread,
Apr 23, 2017, 3:05:28 PM4/23/17
to SimpleForm
Use this instead: 
<%= simple_form_for(@resource, url: resource_path) do |f|  %>
Reply all
Reply to author
Forward
0 new messages