On 25 Apr 2008, at 12:19, John Smith wrote:>
>
> <% for repair_ticket in @repair_tickets %>
> <tr class="<%=
cycle(''odd'',''par'')%>">
> <td><%=h repair_ticket.client.name %> </td>
> </tr>
> <% end %>
> </table>
>
>
> I want only to show the first 10 letters of client.name. Can I do that
> only with HTML? Should I use Ruby?
rails has the truncate helper, so in this case
truncate(repair_ticket.client.name, 10)
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---