Last active
December 24, 2015 10:48
-
-
Save dasibre/6786245 to your computer and use it in GitHub Desktop.
basic ujs issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new.js.erb file has the following js code | |
$('a.pinbutton').on('click', function() { | |
$(this).parent().append('<%= escape_javascript(render("select")) %>') | |
}); | |
here's the player index with the new link | |
<%= link_to "Pin", {controller: "pinboard_players", action: "new", id: player}, remote: true, class: "pinbutton", id: "#{player.id}" %> | |
controller new action action: | |
def new | |
session[:player] = params[:id] | |
@pinboard_player = PinboardPlayer.new(player_id: params[:id]) | |
@current_user_pinboards = get_user_pinboards | |
respond_to do |format| | |
format.html | |
format.js | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment