Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorupupnaway
    • CommentTimeNov 17th 2007
     
    Wow, sintags allow me to format my views almost exactly like Ruby on Rails. I just want to make sure I'm using it properly.

    How do I know when to use the {...} brackets, and when to use the Ruby style <%=...%> tags?

    So far what I've been doing is using the brackets {} for operations such as looping, and using the ruby syntax for outputting and modifying via helper methods.

    {loop products}

    <div class="products">
    <h2>{product.name}</h2>
    <%= image_tag(product.image_url) %>
    <%= h(product.description) %>
    <span class="price"><%= number_to_currency(product.price) %></span>
    </div>
    {end}

    Is this proper? Or can I implement sintags more effieciently?
    •  
      CommentAuthorbermi
    • CommentTimeNov 17th 2007
     

    <%= tags are used for calling helpers functions

    You can see block Sintags examples alongside generated PHP code and Ruby-like Sintags for calling view helpers.

    Like in Ruby you can skip parenthesis :)

Add your comments
    Username Password
  • Format comments as