How about this one-liner with nokogiri? This is just an example
require 'nokogiri'
s = '<input type="hidden" name="currentRackU" id="currentRackU" value="11">'
Nokogiri::XML.parse(s).root.attributes['id'].value # currentRackU
You might need to run gem install nokogiri if you don't have nokogiri installed. Write code like this on controller instead of erb file
<% @user = User.find( <I want to grab the above input's value here> ) %>