On May 5, 6:23 am, Clem Rock <[email protected]> wrote:
> I'm still trying to get used to REST concepts and forms
>
> I have a very simple controller that updates user profile data.    I
> have this link that takes me to the controller:
>
> <%= link_to('Profile', :controller => "operator_profile", :action =>
> "edit") %>
>
> I then want to simply display the operator's data like this:
>
> def edit
>   @operator = Operator.find(current_operator.id)
> end
>
> and I want a form that posts to a update method in operator_profile.
> in my routes I have
>
> resources :operator_profile
>
> I feel like I'm completely locked into the 7 base methods of REST and
> everything else throws routing errors

It's just shorthand -  you could create the 7 routes on their own, ie
match 'operator_profiles/:id', :to => 'operator_profiles#index'

Or you can pass :only or :except to resources to say you don't want
all 7. Lastly since you have a concept of current_operator, maybe
resources :operator_profiles just isn't the right fit (since for
excample your edit or update actions don't require an id parameter).
You could try the singleton one (ie resource :operator_profile)

Fred
>
> I couldn't even get the update method to work.
>
> Can this be simplified?
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
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