Restrict Access to Create Action to Particular User Model?

I have two user models one for businesses and one for buyers. How would
I be able to restrict the create method only for businesses and allow
the show actions only for buyers?

Have a look at the cancan gem for handling roles.

Colin

Colin Law wrote in post #1166335:

David,

Have a look at pundit gem as well. I’d recommend that for simplicity.

Vivek

On that note, I think cancan is cancancan now?

(https://github.com/ryanb/cancan vs https://github.com/CanCanCommunity/cancancan)

Does anyone know what happened there? I think Ryan Bates took a break or something?

Jason Fb wrote in post #1166396:

On that note, I think cancan is cancancan now?

(https://github.com/ryanb/cancan vs
https://github.com/CanCanCommunity/cancancan)

Does anyone know what happened there? I think Ryan Bates took a break or
something?

Jason Fleetwood-Boldt
tech@datatravels.com
http://www.jasonfleetwoodboldt.com/writing

All material © Jason Fleetwood-Boldt 2014. Public conversations may be
turned into blog posts (original poster information will be made
anonymous). Email jason@datatravels.com with questions/concerns about
this.

I installed the original cancan. Which is working, but I have the
slightest clue to what's going on with cancancan.

+1 for Pundit. I prefer it over CanCan these days, especially for your use-case.

Jim

unknown wrote in post #1166545:

+1 for Pundit. I prefer it over CanCan these days, especially for your
use-case.

Jim

Alright, I'll uninstall CanCan for Pundit. Thanks.

Try them both and then use the one that most suits your needs. Anyway
you do not need to uninstall cancan, just remove if from Gemfile and
insert pundit instead (plus making any changes to the code of course).

Colin

Colin Law wrote in post #1166563: