Check out the routing guide here -
http://guides.rubyonrails.org/routing.html


Chirag
http://sumeruonrails.com



On Mon, Jul 11, 2011 at 2:06 AM, Fed Up <[email protected]> wrote:

> I haven't been able to find an answer yet, and unfortunately I can't
> find anything useful in the API docs to fix this...
>
> I scaffolded exercise_model, but I want all the URLs to be /exercise/*
> That means changing
>    form_for @exercise_model
> into what?  I already have this entry in routes:
>    post 'create_exercise' => 'exercise_models#create'
>
>
> A.    form_for @exercise_model, :url =>
> create_exercise(@exercise_model)
>
> That fails on the submit because action="/exercise/create?format="
> makes Rails respond with "Completed 406 Not Acceptable"
>
> B.    form_for @exercise_model, :as => :exercise
>
> Fails to render the page because there is no class Exercise.
> And all 3 of these give the very same URL as #1 above:
>
> C.    form_for @exercise_model, :url =>
> create_exercise(@exercise_model), :format => :html
>
> D.    form_for @exercise_model, :url =>
> create_exercise(@exercise_model,:format)
>
> E.  or in routes.rb, making it
>    constraints :format => "html" do
>        create_exercise => "exercise_models#create"
>     end
>
> What's the trick, or can't Rails do this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to