Rails:重定向到特定的 Twitter Bootstrap 选项卡 [英] Rails: redirect_to specific Twitter Bootstrap tab
本文介绍了Rails:重定向到特定的 Twitter Bootstrap 选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将重定向更改为特定页面上的特定 Twitter Bootstrap 标签?类似的东西:
How would I change a redirect to a specific Twitter Bootstrap tab on a specific page? Something like:
def destroy
@custom_article = CustomArticle.find(params[:id])
@custom_article.destroy
respond_to do |format|
format.html { redirect_to documents_url[#specific_tab_here?] }
format.json { head :no_content }
end
end
谢谢!
更新
参见@PeterWong 和@emm 的答案组合以获取解决方案.
See @PeterWong's and @emm's answers combined for a solution.
推荐答案
这个怎么样?
redirect_to "#{documents_url}#specific_tab"
这篇关于Rails:重定向到特定的 Twitter Bootstrap 选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文