code_junkie

How to capture an anchor value from url in Ruby on Rails?

Nov 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. if record.save
  2. ....
  3. redirect_to records_url, :anchor => "record_" + record_id.to_s
  4. end
  5.  
  6. var record_id = window.location.href.hash.split("_")[1];
  7.  
  8. var record_id = window.location.href.hash.split("_").last;
Add Comment
Please, Sign In to add comment