Skip to content

Instantly share code, notes, and snippets.

@inossidabile
Created May 29, 2012 18:11
Show Gist options
  • Save inossidabile/2829817 to your computer and use it in GitHub Desktop.
Save inossidabile/2829817 to your computer and use it in GitHub Desktop.
Joosy / Helpers
!= @formFor resource, {class: 'foo'}, (f) ->
!= f.label 'field', {class: 'foo'}, 'inner text'
!= f.radioButton 'field', 'value', {class: 'foo'}
!= f.textArea 'field', {class: 'foo'}
!= f.checkBox 'field', {class: 'foo'}
!= f.textField 'field', {class: 'foo'}
!= f.fileField 'field', {class: 'foo'}
!= f.hiddenField 'field', {class: 'foo'}
!= f.passwordField 'field', {class: 'foo'}
Joosy.helpers 'Application', ->
@piratish = (text) -> text + " yarrr!"
!= @nl2br "foo\nbar"
-# templates/widgets/_title.jst.hamlc
%h1
%i.icon-book
= @piratish(@title)
%sup.badge.badge-success
24.05.2012
# helpers/pirates.js.coffee
Joosy.helpers 'Pirates', ->
@piratish = (text) -> text + " yarrr!"
!= @tag 'div', {id: 'foo'}, 'content'
= @renderWrapped '_partial', ->
%span Inner
-# _partial.jst.hamlc
#content
!= @render 'layouts/_menu'
!= @yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment