top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

RoR: How to define multiple conditions for one ability for CanCan

+2 votes
325 views

I have code:

if user.role == "topmanager" can :read, ActiveAdmin::Page, :name => "Dashboard"  can :manage, Realty, agent: {agency_id: user.agency_id}...

And I want to add another condition, can :manage, Realty, agent: nilHow to do it? Defining it two times gets error:

UNDEFINED METHOD `REFLECT_ON_ASSOCIATION\' FOR CLASS:CLASS

How can I define multiple conditions for one ability?

posted Feb 17, 2014 by Amit Mishra

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I have 4 tables from the first table, I took all data from the two columns and displayed it in the view. For each data, I have two text fields and the user is supposed to fill those data. Having filled data into the text field, how can I insert all the records into the second table using one form only?

+1 vote

I deployed one small app in heroku built on ROR, now I want to send mails. How is it possible can anyone give me a details how to do it.

+2 votes

How to convert utc time to a time in a particular time zone. As I need to display local time of Timezone(-05:00).

+1 vote

My Ruby on Rails App needs to connect to a ODBC Datasource that has SSL only enabled.

Can somebody give me an example of connecting to a ODBC Source with SSL?

I constantly get SSL required error. I don't see the option of passing SSL Certificates via UnixODBC. May be something I am missing.

+2 votes

How to set up a means to automatically send an email from certain parts of troubled code, that is, very often, code that might appear in the Rescue predicate of a begin.....rescue, so as to track down issues remotely.

Surely there must be a gem for such? If not, how might one construct something like this in code?

...