Skip to content

Instantly share code, notes, and snippets.

View rvanlieshout's full-sized avatar

Rene van Lieshout rvanlieshout

View GitHub Profile
<tbody>
<% products.each do |product| %>
<tr>
<td><%= link_to product.name, product %></td>
<td><%= truncate(strip_tags(product.description), :length => 80) %></td>
<td><%= product.price %></td>
</tr>
<% end %>
</tbody>
def initialize(user)
if !user.nil? && !user.role.nil?
# internal employee
if user.company_id == 1
can :manage, :all
# consumer
else
user.permissions.each do |permission|
if permission.is_internal?