Lighthouse has a new layout.
Prefer the old one? Return to the old layout,
and switch back any time from the link at the top of each page.
This project is archived and is in readonly mode.
form_for doesn't work with an uncountable route
#681
def new
@news = News.new
end
<% form_for(@news) do |f| %>
...
<% end %>
This code throws error:
ActionView::TemplateError (news_url failed to generate from {:action=>"show", :controller=>"news"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["news", :id] - are they all satisfied?)
As workaround i use more verbose version of form_for:
<% form_for(:news, news_index_url) do |f| %>
...
<% end %>
But it would be better to use same syntax in case of uncountable resources.