开发者

Working with router.rb

开发者 https://www.devze.com 2023-02-20 01:01 出处:网络
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..

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

0

精彩评论

暂无评论...
验证码 换一张
取 消