以下の内容はhttps://tbpgr.hatenablog.com/entry/20130708/1373298717より取得しました。


Ruby on Rails | ActionVeiw::Helperのlink_toでaタグを出力する

概要

ActionVeiw::Helperのlink_toでaタグを出力する

内容

ActionVeiw::Helperのlink_toでaタグを出力します。

= link_to 'label', :controller => 'controller_name', :action => 'action_name'

仕様

Bookshelfページにリンクが2つあります。
「click link」リンクを押下するとリダイレクトにより
ヘルプページに遷移します。

サンプルコード

view/bookshelf/index.html.haml

%h1 Bookshelf#index
%p Find me in app/views/bookshelf/index.html.haml
%hr/ 
=form_tag("/help/index", method: "post") do
  %input{:type => "text", :name => "bookname"}/ 
  %input{:type => "submit", :name => "submit", :value => "submit"}/ 
  = link_to 'click_link', :controller => 'bookshelf', :action => 'click_link'
  = link_to 'message', :controller => 'bookshelf', :action => 'message'

結果




以上の内容はhttps://tbpgr.hatenablog.com/entry/20130708/1373298717より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14