I have a problem due to scopes and the form_for helper in rails 3.
The routes - file looks like this:
scope "(/:tab)" do
resources :article
end
The form looks something like this:
<%= form_for(@article) %>
<%= f.label :title %>
<%= f.text_field :title %>
etc.
<%end%>
The tab - attribute is stored in params[:tab], as a string
My problem is that this genereate wrong urls in the form. How could I get this to work ?
The genreated url article_path(params[:tab], @article) works perfectly fine
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…