Allow body for remote link with method POST #163
Allow body for remote link with method POST #163emerleite wants to merge 4 commits intorails:masterfrom
Conversation
…I needed this in my project for a link inside another form, wich I could not insert a form inside another form. Should be usefull for other people.
|
Forgot a comment in src/rails.js. Please remove when integrate. Cheers |
|
Nice work. And thanks for the tests. I have two comments.
|
… data-body. Seems better.
|
The |
|
I've used data-body because it is actualy de body for a POST or PUT request. data-params can be ok too, but I still prefer data-body, because it's more glued to the real purpose, that is send a request body. What do you think? Any other ideas? |
|
I agree with that part. However, "body" only makes sense in the context that it's for a In the more generic context that this is an attribute for a
To me, hands down, it should be called I think |
|
Changed to data-params. Really makes more sense. |
|
Awesome, Emerson, thanks for your patience and work on this new feature :-) Especially with the test coverage, much appreciated. I squashed your commits into 1 and pulled them in. dad6982 |
|
;) |
Allow link_to with remote => true for method POST with request body. I needed this in my project for a link inside another form, wich I could not insert a form inside another form. Should be usefull for other people.
Example: <%= link_to "something", path, :remote => true, :method => 'post', "data-body" => "key1=val1&key2=val2" %>