Created
October 19, 2011 09:01
-
-
Save oivoodoo/1297792 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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