Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorupupnaway
     
    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
     

    <%= 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 :)