Skip to content

Instantly share code, notes, and snippets.

@jdibiccari
Created July 1, 2014 04:27
Show Gist options
  • Save jdibiccari/6ff8249c964afb26a83e to your computer and use it in GitHub Desktop.
Save jdibiccari/6ff8249c964afb26a83e to your computer and use it in GitHub Desktop.
blog_post
#Utilize the helper variable
helper.truncate("Rails is a magical thing", length: 11)
#=>"Rails is..."
helper.pluralize(2, "sandbox")
#=> "2 sandboxes"
#Or the app variable...(don't mind me as I switch domains)
pond = Pond.last
app.pond_path(pond)
#=>"/ponds/9"
#How about app and helper!
helper.link_to(pond.name, app.pond_path(pond))
#=> "<a href=\"/ponds/9\">Greenwood</a>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment