I am using Ruby on Rails 3 and I would like to state an action method in a my controller file so that in my view files I can use something like the following:
link_to("Delete", posts_path(@post.id), :method => :delete)
That is, to have a link so that I can “directly” call and run an action method in my controller.
In the above code, for example, it is possible to call the destroy method adding :method => :delete.
You can try this.It works in my case.