【问题标题】:redirect to an item of edit page after creating object ruby创建对象 ruby​​ 后重定向到编辑页面的项目
【发布时间】:2017-05-05 17:58:51
【问题描述】:

我需要重定向到编辑页面中的特定项目,我使用了重定向但无法添加#tab_id 这是我的源代码:

  if @song.save
  flash[:notice] = I18n.t('message.success')
  #render action: 'edit'
  redirect_to edit_song_path(@song.id)#tablineT_18_5

tab_id 被命名为:'#tablineT_18_5'

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 slim-lang


    【解决方案1】:

    试试类似的,

    redirect_to edit_song_path(@song, :anchor => "tablineT_18_5")
    

    另外,看看这个帖子https://stackoverflow.com/a/4981205/2403343

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-17
      • 2020-06-10
      • 1970-01-01
      相关资源
      最近更新 更多