Ruby Quicktips Logo

Ruby Quicktips

Random Ruby and Rails tips.
This blog is dedicated to deliver short, interesting and practical tidbits of the Ruby language and Ruby on Rails framework. Read more...

Your submissions are more than welcome!
May 1 ’12

Try out your helpers in the Rails console

Ever wanted to try out any of Rails’ view helper methods in the console? Just include ActionView::Helpers after starting the Rails console:

include ActionView::Helpers
# => Object
text_field(:post, :title)
# => "<input id=\"post_title\" name=\"post[title]\" size=\"30\" type=\"text\" />"

4 notes 0 comments

  1. rubyquicktips posted this

Comments

You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.

blog comments powered by Disqus