After updating or creating an entry, I use the URL helper to redirect to the part on which the entry was found:
if record.save .... redirect_to records_url, :anchor => "record_" + record_id.to_s end
the resulting URL will look like
http: // localhost: 3000 / records # record_343242
I want to highlight an entry using jquery or prototype, and binding is the exact identifier I'm looking for. Can i grab it?
I assume you are trying to capture it in JavaScript?
var record_id = window.location.href.hash.split("_")[1];
In Prototype, you can write:
var record_id = window.location.href.hash.split("_").last;
Source: https://habr.com/ru/post/1697615/More articles:C ++ Standard - c ++Что вы используете для проверки расширения вашего браузера/BHO? - internet-explorerЕсть ли инструмент, который будет смотреть на мой Java-код и предложить хорошую структуру пакетов? - javaWhat are the methods for recognizing words in a sound stream? - computer-scienceHow to allow a user to use their own domain name for a hosted service? - asp.netС какими интерфейсами GUI является Mono.NET Windows.Forms? - .netASP.NET MVC and ... YUI? JQuery? Others - jquerybash getopts function that breaks command line options? - bashHow to determine development time in a VS.NET 2003 library project - visual-studio-2003Application Distribution for iPhone 2.1 vs 2.0 - iphoneAll Articles