On Sat, Nov 20, 2010 at 5:22 PM, Jose tomas R. <li...@ruby-forum.com> wrote:

> i notice, thanks
> i use that line too mucho on my code so i made on ApplicationControlller
>
>  def privilege
>    (session[:user_id].exist? && session[:user_id].privilege == 50) ?
> true : false
>  end
>
>
> and on the actual page i put
>
> <%= :privilege ? link_to('Edit', edit_product_path(product)) : "" %>
>
> but it doesnt work
>

There might be other issues, but the reason you can not access it is that
you either need to put it in a helper (app/helpers), *or* make your code in
the application controller look like:

  helper_method :privelige
  def privelige
   # your code here
  end



>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to