Displaying 20 results from an estimated 500 matches similar to: "Rails controller problems"
2012 Aug 10
1
Persistent, sporadic failure in make_bak_dir mkdir
Through several versions up to and including the current 3.0.9 I experience sporadic, repeating (but not predictably) errors of this form:
> rsync: make_bak_dir mkdir "/REPO/backup/XXXX-data1-20120727-040453" failed: File exists (17)
> rsync: keep_backup failed: "/REPO/backup/XXXX-data1/data1/A182/tb5178/tb5178.hebb/out.TENT_warn.txt" ->
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
2010 Dec 31
1
WickedPDF - wrong number of arguments
I''m trying to get this plugin to work for me. I''m having the
following issue when I try to render a pdf (/fancy_things/45.pdf )..
Any suggestions?
Thanks!
ERROR:
Started GET "/fancy_things/45.pdf" for 192.168.66.1 at Fri Dec 31
10:59:07 -0500 2010
Processing by OrdersController#show as PDF
Parameters: {"id"=>"45"}
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
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
2008 Apr 04
0
named_scope and ordering
Hi,
this is a general design question and I liked to see how other people
handle the following situation: Before named_scope I wrote custom
finders for my model classes. Something like
# order.rb
class Order < ActiveRecord::Base
class << self
def find_all_marked
find(:all, :conditions => {:marked => 1}, :order => ''name ASC'')
end
end
end
Now
2007 Sep 17
0
assertion failed after too many links error
While using dirvish, I ran into a runaway rsync process, which was
continually spewing errors after encountering a "Too many links" error.
This was with 2.6.9.
I tried it again with the latest cvs version, and now at least it
doesn't endless-loop with errors, but instead gives an assertion error.
To reproduce:
$ cd /tmp
$ mkdir a b
$ cd a
$ date > a
$ x=1
$ while ln a a$x; do
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 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:
2008 Jun 05
3
how to specify controller '/admin/foo'
WeBrick handles the link correctly on development, but apache in
production does not:
<%= link_to "Orders", :controller => ''/admin/orders'', :action => ''index'' %>
The controller lives in ./app/controllers/admin/orders_controller.rb
From the production log, apache is looking for the "orders" action in
2011 Nov 28
4
getting a subdomain name in model.
Hi all,
I am facing problem in getting subdomain name inside the model. The
following is my setup.
I am using cancan for authorization.I wanted a specific condition in
Ability.rb ( the file which is placed in models if we install cancan gem).
Below is the condition I wanted:
=========================================================
user ||= User.new # guest user (not logged in)
if
2012 Jun 09
7
ActiveRecord::AssociationTypeMismatch in UsersController#update
Hi
Im trying to link my User model to a Teams model. I seem to be getting
the following errors. Any help would be great as Im just new to RoR
Thanks
error
ActiveRecord::AssociationTypeMismatch in UsersController#update
Team(#2183395560) expected, got String(#2174675960)
app/controllers/users_controller.rb:67:in `update''
app/controllers/users_controller.rb:66:in `update''
2006 Jan 06
6
HABTM problem not saving all associations
Hello all,
I have an Order object that has and belongs to many Products and has
and belongs to many Loan Types. This is so I can select multiples of
each in my order entry screen via checkbox groups.
I''m having some trouble with saving multiple HABTM associations for a
single model object; only the first HABTM association declared in the
model will save during the initial @order.save
2011 May 17
1
rails render_to_string problem
Hi
I`m trying to test my controller with rspec and always get an error.
The error is in the render_to_string method call (without it test
works fine). So could u please help me with that?
users_controller.rb:
def update
@user.update_attributes!(params[:user])
redirect_to @user, :status => 202, :text =>
render_to_string(:partial => "users/show", :type =>
2012 Aug 01
1
Strange error: uninitialized constant Barby::Code128A on Heroku server?
I can`t figure out why on heroku server my app crashed. On local server all
seems works.
2012-08-01T17:14:50+00:00 app[web.1]: NameError (uninitialized constant Barby::Code128A):
2012-08-01T17:14:50+00:00 app[web.1]: app/models/order.rb:102:in `generate_shipment''
2012-08-01T17:14:50+00:00 app[web.1]: app/models/order.rb:60:in `generate_items''
2012-08-01T17:14:50+00:00
2006 May 15
0
losing validation error messages
Hello all,
I am pretty new to Rails and have recently started on a simple
project with it..
I have a simple home_controller and home/index.rhtml page that
displays a login/registration form.
The login/registration actions are handled by users_controller.rb.
register action in users_controller always redirects back
to :controller => "home", :action => "index"..
The
2008 Apr 30
1
Admin namespace not working with duplicated action
Hi,
I have decided to setup my Rails app with a public and admin side.
To manage a list of users, I have a public
app/controllers/users_controller.rb where users can list there friends.
And an admin side: app/controllers/admin/users_controller.rb where all
registered users are listed and on which I can do some account
management.
In the routes files I have:
map.resources :users
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
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