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
>
In a very similar situation I defined the scope in routes like below:
scope :path => ":election_id", :as => "election" do
resources :questions
end
Now I have helpers like election_questions_path(@election)
In the forms I can use:
form_for [@election, @question] do |f|
...
end
In above examples @election is an instance of the Election model.
After integrating Friendly_id into this solution I got some pretty urls. For example "http://mydomain.com/elections-2012/questions/my-question"