Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

Cameron Stitt's Profile

GitHub User: cam-stitt


Comments by Cameron Stitt


Only just checked back, and will now be watching Part 2. Can fix up my dodgy fix :)


I am sure you will put this in Part 2, but I am implementing this in an app right now and needed a way to ensure they were an admin for the associated member they were viewing.

if !current_permission.allow?(params[:controller], params[:action], params[:id])

Then you can use the Id to fetch and check on an item if needed.

return true if controller == "projects" &&[edit]) && Project.find(id).user == user

I was having issues with upper/lower case searching with pg_search. I then went and changed my query to match something like to_tsvector('english', title) @@ to_tsquery('english', :q) and it worked. Do you have any ideas why this would be the case?


I can confirm that this method works. Thanks for the example.