Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var itemId = $(e.currentTarget).data('item-id');
- document.cookie = 'clicked_item_id=' + itemId.toString();
- cookies[:clicked_item_id]
- cookies["clicked_item_id"]
- What I wanna do is this:
- When users click an item, if he's not logged in,
- pop up modal and let him go to login form(save item_id in JS).
- After logged in(read item_id in Rails), redirect to the item detail page.
- Because the pop up modal is implemented by JS, I must share values between JS and Rails.
Add Comment
Please, Sign In to add comment