Topic: understanding link_to
class User < ActiveRecord::Base
has_many :stories, dependent: :destroy
class Story < ActiveRecord::Base
state_machine :state, :initial => :new do
event :start do
transition :new => :started
match '/story', to: 'stories#new'
In my view I need buttons that calls state methods for example @current_story.start.
link_to 'start', @current_story, action: 'start', class: 'btn btn-mini'
but it opens localhost:3000/story.1 with my new.html.haml. What I'm doing wrong?