Re: [Rails] How to run view helpers from rails console?
Test them from tests.
On Wed, May 29, 2013 at 4:25 PM, Wins Lin <lists@ruby-forum.com> wrote:
> With
>> rails console --sandbox
> I cant test my models, save data to db and all will be rolled back
> after.
>
> But is it possible to test view helpers from console? I talk about these
> helpers:
>> post_path
>> link_to
>> url_for
>> edit_post_path
>> new_post_path
>
> When I call them, I get an error:
> irb(main):003:0> post_path(:post)
> NameError: undefined local variable or method `post_path' for
> main:Object
>
> Is there a way to call those methods from Rails console? Through which
> object do I need to call them?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7184cd47c4759192a252fc923e70d66e%40ruby-forum.com?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t8wWOA52t7cu-%3DVGK_UipTXoCkzG_kRSaEiOY49XnPNRA%40mail.gmail.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home