Restrictings actions to post requests only


#1

Hello

Isn’t there a new declaration for restricting actions to post requests
only ? I cannot retrieve it in the changelog (or did I dream it ?)

Thanks !


#2

If you use the @request.post? in an if statement you can write
conditional
code based on the request method. There is also @request.get? and @
request.xhr?


#3

On 11/26/05, Liquid removed_email_address@domain.invalid wrote:

If you use the @request.post? in an if statement you can write conditional
code based on the request method. There is also @request.get? and
@request.xhr?

No, I was thinking about declaring method writtent like has_one :foo.
Ex:
post_only :create, :delete


#4

On Friday 25 November 2005 23:47, Jérôme L wrote:

Isn’t there a new declaration for restricting actions to post
requests only ? I cannot retrieve it in the changelog (or did I dream
it ?)

See
http://api.rubyonrails.org/classes/ActionController/Verification/ClassMethods.html

Michael


Michael S. Life is what happens
mailto:removed_email_address@domain.invalid While you’re making plans
http://www.schuerig.de/michael/ --Kevin Gilbert, A Long Day’s Life