概要
Controllerからテキストのレンダリングを行う
サンプルコード
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'
bookshelf_controller.rb
class BookshelfController < ApplicationController def index render layout: "html5_layout" end def click_link redirect_to :controller => 'help', :action => 'index' end def message render :text => "message test" end end