Working with router.rb
Hey! I have (for instance) this:
@w1 = rand(9999999)
@w = Digest::SHA1.hexdigest(@w1.to_s)
and i get : 6437gdfghfijd8794tyr98vdhf (code).. Okei.. In rails How could I put this code in my url.. something like this: localhost:3000/6437gdfghfijd8794tyr98vdhf ?
#router.rb
map.about '/@w', :controller => 'ans', :action => 'index'
开发者_开发技巧
How add hash parameter to url using redirect_to?
This should give u some idea.
Or if u want to use it in your view: http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to
精彩评论