hi i have a mistake since this morning .
undefined method `name' for nil:NilClass
Extracted source (around line *#15*):
13
14
15
16
17
18
end
def admin?
self.role.name == "Admin"
end
def seller?
self.role.name == "Seller"
Le mardi 18 juillet 2017 00:07:07 UTC-4, babacar thiam a écrit :
>
> I go to create a teste app using
> https://hibbard.eu/authentication-with-devise-and-cancancan-in-rails-4-2/
> <https://www.google.com/url?q=https%3A%2F%2Fhibbard.eu%2Fauthentication-with-devise-and-cancancan-in-rails-4-2%2F&sa=D&sntz=1&usg=AFQjCNH5XqBe4MjC0esD9OnE5NRxIfGgkg>
>
> simple user project and role.
> If it will run normally i could contact you else i i give you our mistake
>
> Le lundi 17 juillet 2017 23:41:50 UTC-4, babacar thiam a écrit :
>>
>> yeah i see this moment i create a simple web app i use devise and
>> cancancan
>> but i cant creer a select form to insert role id in the database for
>> using html files devise/registrations.
>> In your github i dont undertand how to use its when i import then i have
>> many thing aborted
>>
>> Le lundi 17 juillet 2017 23:29:07 UTC-4, David Gleba a écrit :
>>>
>>> The role_id is a column in the users table.
>>>
>>> The role.rb model and the user.rb model are related.
>>>
>>>
>>> In user.rb the roles are processed.
>>>
>>> I find it is helpful to try to add the feature you want to a fresh plain
>>> test project.
>>>
>>> When you can add it to a test project, then try to add it to your
>>> project.
>>>
>>>
>>>
>>> On Mon, Jul 17, 2017 at 11:22 PM, babacar thiam <[email protected]>
>>> wrote:
>>>
>>>> I use mac os x.
>>>> I want to use your app to see specifically how use Rbac in a simple app.
>>>> And in my app i don't undertand how to link user to a specifique role.
>>>> in devise/ folder i can't see an in the form how to add role id
>>>> and if i want to add user in the seed file i have a error.
>>>>
>>>> Le lundi 17 juillet 2017 23:07:17 UTC-4, David Gleba a écrit :
>>>>>
>>>>> What operating system are you using?
>>>>>
>>>>> Can you download the bashrail project to your PC and follow the
>>>>> instructions in the README.md.
>>>>>
>>>>> I wonder if you can run it as it is and see if it generates a rails
>>>>> app you can run. Then we can break it down into smaller pieces and try to
>>>>> understand what it is doing.
>>>>>
>>>>>
>>>>> On Monday, July 17, 2017 at 7:38:30 PM UTC-4, babacar thiam wrote:
>>>>>>
>>>>>> i want to use your script to test how implement robe based access
>>>>>> control .
>>>>>> I hav a problems to import this or to add some file in my projet.
>>>>>> I can't see the views who create user our assign a role to a user its
>>>>>> my matter.
>>>>>> help need if i could have our contact to communicate fastly.
>>>>>> need u david Dleba
>>>>>>
>>>>>> Le lundi 17 juillet 2017 18:46:21 UTC-4, babacar thiam a écrit :
>>>>>>>
>>>>>>> i look our script AND I COME WITH U IF I HAVE NEW
>>>>>>> Le vendredi 14 juillet 2017 06:44:52 UTC-4, David Gleba a écrit :
>>>>>>>
>>>>>>>> I use devise and cancancan for login and roles.
>>>>>>>>
>>>>>>>> In my little rails app generator project:
>>>>>>>> https://github.com/dgleba/bashrail there are scripts for this.
>>>>>>>> Even if you don't use the scripts, they document exactly how to
>>>>>>>> implement
>>>>>>>> it in that case.
>>>>>>>>
>>>>>>>> look at:
>>>>>>>> https://github.com/dgleba/bashrail/blob/master/devise1.sh
>>>>>>>> https://github.com/dgleba/bashrail/blob/master/cancan1.sh
>>>>>>>>
>>>>>>>> When I am learning something like this I strip the scripts down to
>>>>>>>> just what is needed to create an app with the feature I am studing.
>>>>>>>>
>>>>>>>> This app, https://github.com/dgleba/brail351d
>>>>>>>> <https://github.com/dgleba/brail351d>, was generated by bashrail
>>>>>>>> and has fully functional roles like mention in your question.
>>>>>>>>
>>>>>>>> David
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thursday, July 13, 2017 at 4:43:41 PM UTC-4, babacar thiam wrote:
>>>>>>>>>
>>>>>>>>> Hello guys i want to implement rbac autorisation for a rails app.
>>>>>>>>> i use devise to generate user and i have a product controllers.
>>>>>>>>> am a beginners at rails and i want to use:
>>>>>>>>> user role show
>>>>>>>>> admin role edit
>>>>>>>>> speruser role delete
>>>>>>>>> I don't know how to implement this i use cancan and i have a
>>>>>>>>> problem to affect a role to a user
>>>>>>>>>
>>>>>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Ruby on Rails: Talk" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/rubyonrails-talk/oHSqL1aYLs0/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To post to this group, send email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/rubyonrails-talk/75f291b1-a395-4224-87a0-7ed0b2eeccf4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> [email protected]
>>>
>>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/83dbd203-e1d8-44c2-b0b9-1d84db5cce90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.