我需要指定一个哈希来添加到redirect_to.我该如何做?
这是我的redirect_to形成的方式:
redirect_to :action => 'show',:id => @consultant.id
我需要去example.com/consultant/#some_hash
谢谢!
解决方法
尝试redirect_to your_current_options,:anchor => ‘fragment_identifier’
http://api.rubyonrails.org/classes/ActionDispatch/Routing/UrlFor.html#method-i-url_for