LoginSignup
2
1

More than 5 years have passed since last update.

Railsでの開発中のテキスト表示

Last updated at Posted at 2015-02-17

railsで処理をとめてテキストの表示をするとき。

render :text => "aaaa"

結構単純ですが値の確認とか使いどころは多いかも。

render :text => "upper = #{params[:upper]}, lower = #{params[:lower]}"

他にもフォームから送信された、 prams[:article]の値を表示するには以下なども。

render plain: params[:article].inspect

「.inspect」を付ければ、オブジェクトの中身がログに出力されます。

あれ?なんで?というちょっとしたところでよく使いますね。

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1