Conversation
…n when a post request use render_component For example using render :active_scaffold in the layout, when a post request fails due to validation errors, render_component fails due to forgery protection, clears your session, and it will logout you for example.
|
But does nt that change the request completely, I mean a post is nt a get? |
|
I will explain in more detail: I have a layout with render :activescaffold => :controller, :params => {:action => :new} to show a quick form to create a model. To render a new action the request must be a GET. In a get request, index for example, it works right. But in a post request, when it renders the layout, render_component tries to render the new action as a post request, then it tries to check forgery protection and it fails. |
|
I think this make sense... I don't see a problem. Except that I don't think I needed to make this change, would it be possible to write a test to reproduce the problem? |
All requests should be get, it was failing due to forgering protection when a post request use render_component
For example using render :active_scaffold in the layout, when a post request fails due to validation errors, render_component fails due to forgery protection, clears your session, and it will logout you for example.