In_place_editor_field - "No Route Matches" Error

I’m trying to create an edit in place profile update page, using
in_place_editor_field. Every time I try, I keep getting this error

No route matches {:action=>“set_user_first_name”, :id=>“1”}

Would any know what the problem might be? The relevant code is blow.

Link to users_controller.rb

in_place_edit_for :user, :first_name

profile edit page

def update
@user = User.find_by_user_name(params[:user_name])
end

Link from index to Update Action

<%= link_to ‘Your Profile’, update_user_url(:user_name =>
current_user.user_name, :id => current_user.id) %>

Update.rhtml

<%= in_place_editor_field :user, :first_name %>

I’m having the same issue. I think it’s because I have the default
routes off, but I can’t find any reference to what the route should
be. If I put the default routes back in just to test, it works.

Wait, I just checked the source. You should see something like this:


//

So, in your case, just make sure that /users/set_user_first_name/ is a
known route and you should be good to go.

Sean

You’re right! I just enabled default routes, and was good to go.

I added the following to the end of my routes.rb.

map.route ‘/:controller/:action’

-Mario

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs