Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update a channel with the _method=PUT hack #15

Open
joelmukuthu opened this issue Nov 6, 2010 · 2 comments
Open

Cannot update a channel with the _method=PUT hack #15

joelmukuthu opened this issue Nov 6, 2010 · 2 comments

Comments

@joelmukuthu
Copy link
Member

When you try to update a channel's info i.e. PUT request to /channels/<channel_id>/ but instead sending a POST request with the _method=PUT hack, ASI throws this 500 error:

ActionView::MissingTemplate (Missing template channels/bkYfG20Smr35GSacyIhg8r.erb in view path app/views):
lib/render_extend.rb:15:in render' app/controllers/application_controller.rb:113:inget_channel'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inrun'
/usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:instart'
/usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart'
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:instart'
/usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart'

Rendering rescues/layout (internal_server_error)

However, updating with the normal PUT request works fine.

@konker
Copy link
Member

konker commented Nov 8, 2010

I'll have a look at this and see if I can re-create the problem locally, then we can take it from there.

@konker
Copy link
Member

konker commented Nov 16, 2010

I have tried this on cos.alpha.sizl.org/test and everything seems to work OK.
Specifically I have:

  • logged in as an application and a user.
  • created a channel:
    POST => /channels
  • updated the channel name the regular way:
    PUT => /channels/, channel[name]=newname1&
  • updated the channel name with the _method hack:
    POST => /channels/, channel[name]=newname2&_method=PUT&

All the above steps have worked as expected.
Can you confirm the exact urls and parameters that trigger the error?

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants