たまーーーにactionの中で実際に返すhtmlを文字列として取得したい場合があるが、いつも忘れてオロオロしてしまうので備忘録として。。。
controller.rb
def show
@html = render_to_string
end
これでhtml取得出来る!!
More than 5 years have passed since last update.
たまーーーにactionの中で実際に返すhtmlを文字列として取得したい場合があるが、いつも忘れてオロオロしてしまうので備忘録として。。。
def show
@html = render_to_string
end
これでhtml取得出来る!!
Register as a new user and use Qiita more conveniently