Reputation: 35
(I'm new to Sinatra)
I have, in my index.erb the following form:
<form method="post" action="play">
<input type="hidden" name="_method" value="put" />
<input type="button" value="Next" name="next" id="next" title="Next" />
...
</form>
and in my app's file (play.rb) I have the following:
put '/play' do
...
...
end
the .erb is under app\views\ and play.rb is under \app.
For the life of me, I can't get the play to be invoked. I've even tried using a post too with no luck. Based on another question asked here, I've included use Rack::MethodOverride for the _method hack. Any idea what I'm doing wrong?
Upvotes: 1
Views: 723
Reputation: 8478
change the button to:
<input type="submit" value="Next" name="next" id="next" title="Next" />
unless you bind the button to some javascript action.
Upvotes: 3