Displaying 20 results from an estimated 1000 matches similar to: "Anonymous Subclass of ActionController::Base"
2012 Nov 17
0
How to get more debug information in test log ?
Im one of my unit tests, I got an error I cannot even start looking for the
issue as few information are logged ...
Using the test console , there is no error at all :
> rails console test
>> Loading test environment (Rails 3.2.9.rc3)
> site1 = FactoryGirl.create(:cms_site, label: "booboo")
>> BEGIN
..
..
>>
but running my tests > unit
> ruby -Itest
2009 Aug 07
4
ActionController::UnknownAction (No action responded to 22.
I try to switch my application from Rails 2.2.2 to Rails 2.3.3.
In namespace :admin I have a resource-based controller. See controller
class Admin::OSystemsController < Admin::BaseController
def index
.......
end
def edit
.........
end
def update
..........
end
end
Resource is added to routes.rb like
map.namespace :admin do |admin|
............
admin.resources :o_systems,
2013 Mar 20
2
Rspec + Devise + BaseController
Hello there,
I''m creating a base controller for the admin section of a project. All
controllers whitin the admin section will inherit from it.
#####################################################
#app/controllers/admins/base_controller.rb
class Admins::BaseController < ApplicationController
layout "admin_cms"
before_filter :authenticate_admin!
end
2005 Dec 28
3
Module loading
I''ve looked high and low for the answer to this and can''t seem to find
anything that helps.
I have an admin section (much like Typo) where all controllers are based
on the Admin::BaseController.
My directory structure is
[RAILS]
-app
--controllers
---admin
----base_controller.rb
----products_controller.rb
Products controller is:
class Admin::ProductsController <
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
2006 Aug 08
2
Extending rails with plugins
I''ve been looking at bottling some functionality up into a plugin, but I''m
having some problems including it.
The structure I have is:
/app/controllers/admin/base_controller.rb:
class Admin::BaseController > ApplicationController
#snip#
end
/vendor/plugins/myplugin/lib/my_module.rb:
module MyModule
def new_func
"New Function"
end
end
2012 Mar 07
0
LoadError: Expected X to define on gem upgrade
I''m upgrading to the latest version of ActiveAdmin and am running into the
following when trying to start the app:
Expected ../app/model/store/base.rb to define Base
base.rb defines base like:
module MyApp
class Store::Base
end
end
I''ve done some digging and found that ActiveAdmin did some refactoring to derive everything from a BaseController. It also depends on
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
2009 May 03
0
HTTP Auth 401 Even on Valid Login
I can''t understand why authenticate_or_request_with_http_basic keeps
failing even though I am entering the correct info.
If I try to access /admin/items/new, I enter the correct info but I
keep getting prompted.
The strange part is that when I cancel out, I get "HTTP Basic: Acce".
Here''s the controllers:
class Admin::BaseController < ApplicationController
2007 Aug 27
0
Want to Move RestfulAuthentication's UsersController to Admin::UsersController
I''m trying to move RestfulAuthentication''s UsersController to an Admin
module--Admin::UsersController--as I''m also adding roles and
permissions for an app I''m building. I would like this all to be
within a single user interface with a standard security level required
for all these pieces as defined in Admin::BaseController.
So far, I''ve been able to
2010 Nov 24
1
NameError in Devise/sessionsController#new
I created a sample application.
Added devise in it, it works fine.
Then added cancan gem into it.
Created an ability class. define some permissions.
Then added line
load_and_authorize_resource
to the Application Controller, after that when i go to the page
http://0.0.0.0:3000/users/sign_in it gave the following error,
NameError in Devise/sessionsController#new
uninitialized constant Session
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
2013 Oct 18
3
before_action - performing an action to prevent
class WebsocketController < WebsocketRails::BaseController
private
def authenticate?
unless current_user.token == message[:token]
current_redirect_to ''home/index''
false # that here we need to do to stop the further execution?
end
end
end
class WorldsController < WebsocketController
before_action :authenticate?
def index
2008 Nov 11
1
Admin controller
This is very weird behavior for rails.
1. When I visit my app
http://localhost:3000/admin/base/login
class Admin::BaseController < ApplicationController
def login
render :text => "running"
end
end
2. but when I go here
http://localhost:3000/
I get error because login.html.erb not found
3. even though my route looks like this.
map.root :controller =>
2006 Apr 04
3
How to use in_place_editor_field ?
Hello, I really don''t understand how to use in_place_editor_field
In my controller :
class Admin::CategoriesController < Admin::BaseController
in_place_edit_for :category, :title
def list
@categories = Category.find_all
end
end
In the view list.rhtml
<% @categories.each do |c| %>
<td><%= in_place_editor_field :c, c.title %></td>
# snip
<%
2008 Aug 15
7
Autotest and subclasses / namespaces
I am writing a controller admin/cities_controller.rb
it inherits from AdminController, so it''s defined like
class Admin::CitiesController > AdminController
Whenever I save the controller file, autotest freaks out:
uninitialized constant Admin::AdminController (NameError)
I''m pretty used to just hitting CTRL-C to get autotest to re-load all
the files, or flicking to
2006 Jan 23
1
learning how models, controllers, and views pass data
As a noob to Rails and web development in general, I think I still need
a broader understanding of how Views, Controllers, and Models pass
information and variables to each other.
I''m creating a site that allows for email campaigns. I have a
''create_email_controller'':
class Admin::CreateEmailController < Admin::BaseController
layout ''admin''
def
2011 Oct 24
1
JQuery autocomplete example
I was trying to follow along on the github example
(https://github.com/crowdint/rails3-jquery-autocomplete) for building
an autocomplete and ran into a small set of problems. I''m not using
the exact names of models, but I suppose I could. It''s just a dummy
set. For me: Model is Package and attribute is Brand.
I don''t understand what the reference to class
2008 Oct 08
0
undefined method add called for ActsAsFerret::Remote::Server
undefined method `add'' called for
#<ActsAsFerret::Remote::Server:0x7f5be279ea38>
I am currently using ferret (0.11.6) and act_as_ferret (0.4.3)
My project is using rails 2.1.1 and ruby 1.8.6 along with sqlite3 and
Webrick.
I can start the ferret server and when I do ''ps aux | grep ferret'' in
terminal I see the ferret server to be running.
I have a model and
2011 Apr 21
1
Rails 3 Foreign Domain routing - cannot get this to work!
Hello,
I''m trying to build an app (mysuperapp.com) that allows users to create
an account in which a default subdomain (IE: joeshmoe.mysuperapp.com) will
be
created as their homepage. In their profile settings, I also want to give
them the ability to add their own domain name so their homepage now can be
joeshmoe.com. I know this is possible in rails w/ plugins like
subdomainfu