2009/11/19 pharrington
>
> For simple cases you could just create a helper like this:
> def admin_only &blk
> yield if current_user.admin?
> end
>
> <% admin_only do %>
> some ISH
> <% end %>
>
>
or a helper like:
def show_user_info
if (current_user.admin?) do
'User is admin.'
elsif (c
Definitely take a look at Florian Hanke's representer-plugin at
http://github.com/floere/representer. It gives you the ability to have
'object oriented' views. You put all the logic (conditionals etc.)
inside methods of the view-object. Much much easier to test and it
results in extra clean views.
On Nov 18, 4:29 pm, ressister wrote:
> I am working on a project that uses quite a bit of conditional logic
> to display information about groups in a list. The partial that
> renders the group attributes will display different info based on
> whether the user is a) logged in, b) the creator of t
3 matches
Mail list logo