Skip to content

Instantly share code, notes, and snippets.

@oivoodoo
Created October 19, 2011 09:01
Show Gist options
  • Save oivoodoo/1297792 to your computer and use it in GitHub Desktop.
Save oivoodoo/1297792 to your computer and use it in GitHub Desktop.
# How to test application helpers via terminal.
# For example you are using devise.
# Type in terminal the next following lines.
class << self
def current_user
User.find_by_name("your username")
end
end
include ApplicationHelper
# if you want to see how your helper is rendering
# content_tag you need to make include module
include ActionView::Helpers::TagHelper
# And now run helper.
your_helper_method_that_will_render_link
"<li><a class=\"c1\" href=\"/\">Home</a></li>"
# That's it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment