=link_to votes_path(type: 'Mix', id: @mix.id), method: :post, remote: true do
alert('hi');
def create
vote = Vote.create(...)
if vote.save
respond_to do |format|
format.html { redirect_to :back, notice: 'Thanks for the vote!' }
format.js
end
end
end
Started POST "/votes?id=38&type=Mix" for 127.0.0.1 at 2013-11-27 14:28:33 -0700
Processing by VotesController#create as JS
Parameters: {"id"=>"1"}
(...Active Record...)
Rendered votes/create.js.erb within layouts/application (0.2ms)
(... other files...)
Completed 200 OK in 25ms (Views: 14.3ms | ActiveRecord: 4.1ms)
Notice, it renders votes/create.js.erb
The test alert('hi')
is not firing and I can't figure out why.
Any guidance?