Helpers in Rails Console

Rails gives you a helper local variable to play with.

$ ruby script/console
Loading development environment. 
>> helper.pluralize 2, "story" 
=> "2 stories" 
>> helper.submit_tag
=> "<input name=\"commit\" type=\"submit\" value=\"Save changes\" />" 
>> helper.visual_effect :blindUp, 'post'
=> "new Effect.BlindUp(\"post\",{});" 

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Difference between Validations, Callbacks and Observers