Ruby on Rails Wednesday, September 29, 2010

It's goes through Admin::PhotographersController#edit action, opening
a form which I have to fill:

def edit
@photographer = current_photographer
end

then it goes to Admin::PhotographersController#update :

def update
@photographer = current_photographer
if params[:id]
# trying to update a specific photographer on a singular
resource is a no-no
flash[:notice] = "You can only update your own settings!"
redirect_to edit_resource_path
else
update!{ edit_resource_path }
end
end

here is the controller http://pastie.org/1189038
and here it is the view http://pastie.org/1189061 ( ... or, follow a
snap )

= form_for(:photographer, @photographer, :url => resource_path, :html
=> { :multipart => true, :method => :put }) do |f|
...
...
%p
= f.label :theme
= f.select :theme, Photographer.themes
%p
= f.label :use_watermark, "Automatically watermark your client
photos?"
= f.check_box :use_watermark
...

Luca

On Sep 29, 10:06 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Sep 28, 9:54 pm, lgs <luca.so...@gmail.com> wrote:
>
> > After migrating my 2.3.9 app to rails 3.0.0 I get this error:
>
> >       Completed 406 Not Acceptable in 513ms
>
> > I also noted that processing controller doesn't output the protocol:
>
> > -- Processing by Admin::PhotographersController#update as
>
> > while if it works, say:
>
> > -- Processing by Admin::PhotographersController#update as HTML
>
> > Here is the full action outputhttp://pastie.org/1187051
>
> > Can anyone help me, please ?
> > Don't know where to start :-(
>
> At a guess it's because the url being posted to is /admin/photographer.
> 1 which may be making part of rails think that the requested format
> is .1 (as opposed .html, .xml etc), so when you get to your respond_to
> block rails can't generate a response and so generates a 406 instead
> (which is http for "I can't generate the kind of response you asked
> for")
>
> Fred
>
> > Luca
>
>

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment