Displaying 20 results from an estimated 1100 matches similar to: "CanCan load_resource get a nil resource"
2012 Oct 09
8
unexpected should_receive behaviour
Hi,
surely I''m missing something... but what!?
in my spec I''ve
User.should_receive(:find).with("1").and_return(@user)
and in my controller
User.find(params[:id])
green light... correct...
but if I change my controller using another method, for example first:
User.first
or even
User.all
I get green light too... I was expecting an error like
expected: 1 time
2012 Nov 05
3
DragonFly Object not found in Production
could please anyone help me with this issue?
http://stackoverflow.com/questions/13237954/object-not-found-in-production
thanks,
enrico
--
· Enrico Stano
·
· twitter @enricostano
· skype ocirneonats
--
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
2012 Nov 04
0
rails-i18n and date_select issue
Hi,
could please anyone help me with this issue?
http://stackoverflow.com/questions/13219204/rails-i18n-date-select-error
Many thanks,
enrico
--
· Enrico Stano
·
· twitter @enricostano
· skype ocirneonats
--
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
2012 Oct 02
0
cancan and authorization on controller actions of a gem.
Hello.
I''ve installed cancan and bigbluebutton_rails,
https://github.com/mconf/bigbluebutton_rails.
The gem bigbluebutton_rails has some models and controllers, for
example has bigbluebutton/servers_controller.rb.
This controller has some actions like create, join, authorize, etc.
I want that only users with role admin can create.
What can I do?
I need to put load_resource in
2012 Mar 30
1
cancan breaks scoped mass assignment
Hi all,
I just installed cancan on a new project and found out that it creates
some problems with the new scoped mass assignment features of rails 3.2
.
Basically, in my User model I create some attr_accessible attributes in
order to avoid users to edit their roles or other sensitive information.
From the administration I allow admins to edit those protected
attributes by passing
2011 Jun 05
1
Cancan redirect back at AccessDenied
Hello
I have a rails 3 app and I am trying to implement the redirect back
action at access denied for cancan.
If I try this in my application_controller:
rescue_from CanCan::AccessDenied do |exception|
redirect_to :back
end
It gives the following error:
No HTTP_REFERER was set in the request to this action, so
redirect_to :back could not be called successfully. If this is a test,
make sure
2014 Mar 25
0
Looking for some glue between Strong Parameters and CanCan
Hello Rails World,
does anybody know a good solution for Strong Parameters in a Rails app
authorized by Cancan (or a similar authorization gem)?
def user_params
if current_user.admin?
params.require(:user).permit!
else
params.require(:user).permit(:password, :password_confirmation)
end
end
Now I want to do this the "Cancan way". My first idea looks strange to me:
def
2014 Mar 25
0
cancan gem being replaced
I just came across this so I thought I would post it on this board since I
see cancan come up a lot. It seems that Ryan Bates (who is primarily
responsible for cancan) is taking a hiatus and the gem is no longer being
actively maintained. The collaborators on that gem have formed a new team
and have released the gem cancancan which is now cancan updated for Rails
4. You read more about it
2011 Mar 02
1
Setting CanCan ability.rs model
I successfully made login system with Devise and CanCan, and I have 3
types of users. Admin, internal and global users. I created
Controllers and index actions: Admin, Cpanel, Report and State, and I
want to restrict access to this controllers for some users.
Admin user should have privilegies to access: Reports(all), State
(read), Admin (all)
Global user should have privilegies to access:
2013 Nov 22
2
Cancan Rspec load_and_authorize_resource
Hello!
While running bundle exec rake, I receive following error (see in
attached file)
However, my tests are steel passing with command rspec spec/controllers/
Some info:
ads_controller.rb:
class AdsController < ApplicationController
load_and_authorize_resource except: :create
end
ads_controller_spec.rb:
require ''spec_helper''
describe AdsController do
render_views
2011 Jul 28
0
CanCan filtering meta_search results?
At the moment, I am running meta_search, and then filtering through
CanCan after I have a set of results. Is there any other way to
restrict the returned objects within the initial search query?
def index
@search =
User
.search :first_name_or_last_name_or_practice_name_or_role_contains_any
=> params[:search].to_s.split('' '')
@users =
2012 Mar 06
0
Devise/Cancan Signout User On Controller Action
I have implemented Devise for Authentication and Authorization in ROR
application everything seems fine but getting one issue. I have two
modals "Account" and "Transactiona" , and so two controllers
respectively.
My Transaction Index view call one of Account Controller method like
this
2010 Dec 02
8
CanCan issue when being very specific
So I got CanCan and Devise working well. I have two types of users:
Admins and Nonadmins. Admins can edit all of Nonadmins profiles.
The problem is, every user (either Admin or Nonadmin) belongs to an
Account or Organization. Admins should only be able to edit users from
their own Account or Organization. I was able to do that too.
The problem is, I can''t display the Create New User
2009 Jan 11
2
Got an error on returning data as json format when the data is nil
Hi there,
One of my app''s actions returns data as a json format.
If the data exists, everything works perfect.
But if the data is nil, I get the following error.
--------------------------------
ActionView::MissingTemplate (Missing template user/show.erb in view
path /var/www/my_app/releases/20090110234348/app/views:):
2014 May 30
1
attachment sis + EMLINK (too many links) = segfault bug (2.2.12)
Hi,
we use attachment dedup with lots of emails (still migrating to it
from maildir).
We use netapp storage with wafl filesystem over nfs.
Problem is that netapp has hard limit of 100k hardlinks to one file.
And we encountered it.
Problem is that dovecot start do segfault (lmtp,dsync,pop3 etc) when it
happend when tried to deliver new emails with that attachment.
Here is strace of dsync:
6740
2014 Apr 03
1
mdbox with mail_attachment_dir per user in 2.2.12
Hello,
we have 2 netapp arrays with 2 volumes and we need to store our mail
data in one or other volume for every user.
We want keep data for one user in one volume only.
So we would like to have 2 separate mail_attachment_dir, one on every
volume.
But in latest version 2.2.12 it look like it is only possible to set
one global mail_attachment_dir.
I have an idea with 2 separate dovecot
2014 Apr 10
1
replication + attachment sis + zlib bug ? (HEAD version from xi.rename-it.nl)
Hi,
i have setup with mail_attachment single instance store + replication +
zlib and got this bug when i try to replicate one test mailbox:
On master1 in mail.log:
Apr 10 13:25:22 master1 dovecot:
dsync-local(zzz at blabla666.sk): Error:
read(/nfsmnt/mailnfs1/attachments1/6b/57/6b57ad34cf6c414662233d833a7801fde4e1cdcb-92b5052558774653a728000013e2b982[base64:18
b/l]) failed: Stream is larger than
2014 Apr 22
0
one way replication
Hi,
anyone using one way (or master/slave) replication instead of
master/master ?
There is no info in documentation but in sources
(src/doveadm/dsync/doveadm-dsync.c) i found some flags which looks like
for setting up master/slave
switch (c) {
case '1':
ctx->oneway = TRUE;
ctx->backup = TRUE;
break;
case
2012 Apr 02
0
uninitialized constant UserController
Rails 3.1.3
I am trying to create an administrator page. ''User'' table has a field,
admin:boolean, then user having ''admin=true'' can only access it, as you
can imagine.
But accessing
http://localhost:3000/admin/user
gives an error,
uninitialized constant UserController
I have ''controllers/admin/admin_application_controller.rb''
class
2006 May 05
2
newbie ruby string match question
All,
I want to know in the Application.rb controller if I''m on the login screen.
When I''m on the page I care about the controller variable is
"#<ActiveRbac::UserController:0x408b3d6c>"
So I want something like:
if controller contains ActiveRbac::UserController
What is the right syntax for the above?
Thanks
Greg
--
Greg Freemyer
The Norcross Group
Forensics