Put a link in a flash[:notice]

后端 未结 8 1507
天涯浪人
天涯浪人 2020-12-04 23:31

I am learning Ruby and Rails.

I have a Ruby on Rails project that tracks jobs a server is running. Right now, when I manually create a new job, it announces:

<
8条回答
  •  难免孤独
    2020-12-05 00:24

    You can use an alias in your controller to the link_to function, or the RailsCast recipe:

    "Created job job number #{@template.link_to update.id, 
      :controller => 'jobs', :action => 'list', :job => update.id}."
    

    http://railscasts.com/episodes/132-helpers-outside-views

提交回复
热议问题