search for: admincontroller

Displaying 20 results from an estimated 88 matches for "admincontroller".

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...
2008 Mar 28
10
Inheriting from AdminController intstead from ApplicationController
Hi I would like to do the following: I have created an admin namespace and the required folders app/admin views/admin etc. And then I wanted all controllers under app/admin to inherit from a controller named AdminController which resists under app/admin/admin.rb instead of inhereting from ApplicationController, so I could better separate between admin and public section. The AdminController looks like this: module Admin class AdminController < ActionController::Base include AuthenticatedSystem helper :al...
2008 Mar 23
1
Object creation when the controller is a subclass of AdminController
...hat the best way to handle administration of a model that displays publicly but is administered privately is through subclassing but I''ve run in to pathing issues (I think) when trying to create an instance of my model. Let''s say I have a Book, and BookController is a sublcass of AdminController so that I can create and delete Books via an Admin section. Everything is going smoothly, I''ve set up my resources so that my controller falls under /admin but it seems to me like my "new Book" form generates it''s action path for books, not Admin Books even though it...
2006 Apr 28
9
[AWDR] Tutorial in A4 wont ''destroy'' items
...tutorial, and I''ve run into a little snag. In the first part of the tutorial, the destroy link is not working correctly. I can''t figure out where I goofed. Removing :confirm doesn''t seem to resolve the issue. Thanks, Randy. development.log ----->8----- Processing AdminController#destroy (for 127.0.0.1 at 2006-04-27 20:50:19) [GET] Session ID: e578c5805fdb4b4abc61674cbb89e6c9 Parameters: {"action"=>"destroy", "id"=>"2", "controller"=>"admin"} Redirected to http://localhost:3000/admin/list Filter cha...
2008 Apr 30
1
NoMethodError in AdminController#index
I am reading Agile Web Development with Rails and after setting everything up with the first application I get the following error: NoMethodError in AdminController#index undefined method `scaffold I then installed the plugin for scaffold and I got this error: undefined method `paginate'' I have read on the web and in this group about installing The paginate plugin but I cannot get it to work and I cannot find the plugin to install. Where do I find t...
2010 Jun 14
7
"NoMethodError in AdminController#index" error
...e got no idea whatsoever why i got this error, the thing that happend was i was doing a little coding along with the lynda.com rails series that i got this error. well as u can see this is the error which i get on terminal, but there is another one in browser too which says : "NoMethodError in AdminController#index " u can see it in the picture here : http://twitpic.com/1wsbal so what seems to be the problem. Attachments: http://www.ruby-forum.com/attachment/4801/Screen_shot_2010-06-14_at_6.55.29_PM.png -- Posted via http://www.ruby-forum.com/. -- You received this message because you are sub...
2006 May 31
5
Sharing code between some controllers? Staying DRY
...ller''s redirect_to(). Copy and paste is bad. I can think of two options but I don''t know how Rails will feel about them. Option 1: Can I create an intermediate controller class like the following? If so, are their pit falls to this method? class ApplicationController end class AdminController < ApplicationController private def redirect_to() end end class ProductController < AdminController end Option 2: I could create a flie in lib/ which contains the redirect_to() method and then mix it into each controller. This option doesn''t feel as good for some reason. Al...
2006 Apr 22
3
Making a separate admin zone
Hi, im building a little cms and i want to separate the admin zone controllers in a subfolder(controllers/admin) if possible to all be managed by one login module, i just have managed simple 3 or 4 controller apps so any help you can give me will be very apreciated. ;) -- Posted via http://www.ruby-forum.com/.
2008 Jun 10
1
NameError in AdminController, uninitialized constant
...title, :string t.column :description, :text t.column :location, :string t.column :image_url, :string end end def self.down drop_table :propertys end end however i get right up to page 77, ruby script/server but i get this: NameError in AdminController#index uninitialized constant Property RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in `load_missing_constant'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/...
2010 Feb 23
1
undefined method `scaffold' for AdminController:Class
Hello everyone! I think a little background is necessary. I''ve been a web-developer and linux user for a little over 4 years now, primarily working with PHP and MySQL. I''ve tried several other frameworks like Django and CodeIgniter and several other languages, including python, perl, ASP/.NET, javascript and javascript frameworks, also worked with Oracle and PostgreSQL and many
2006 Jan 30
2
Modules, controllers and inheritance
Hi! I was trying to cleanup my app and I runned into quite a problem. My controllers in submodule do not seem to inherit things from base class. I have following setup: app/controllers/ application.rb: class ApplicationController admin/ admin_controller.rb: class Admin::AdminController < ApplicationController include LoginEngine include UserEngine before_filter :authorize_action # method defined by LoginEngine homepage_controller.rb class Admin::HomepageController < Admin::AdminController Now when I try to access HomepageController I get N...
2006 Mar 08
3
Namespace & Organisation Conventions
Hi All I wanted a little advice on the convention for namespace usage and organisation of code. I originally used PHP and often had an "admin" backend that performed the various admin tasks with users, and data Then I had a front-end often situated at the root that had user services. I''m trying to emulate this in Rails but feel I''m missing a significant point here and
2006 Jun 06
5
Functional tests and protected actions
Hello! I have certain methods in my Application Controller, that I need to access. Namely ApplicationController#logged_in_user The problem is, that when I try to access it, I get: NoMethodError: protected method `logged_in_user'' called for #<AdminController> Any ideas how I can circumvent that? Or are functional tests really not suited for any kind of logins and session work? I don''t see why I should move everything to a Integration Test just because I added user logins. Any ideas? Thanks, Rob -------------- next part -------------- A...
2006 Aug 14
1
AWDWR Chpt6: Webrick Get...200... then ...500...
Hi, Rails produces to diff Gets on the Webrick: AWDWR Chpt 6 strange results: First browser call to /Admin shows correct form; - And WEBrick reports: "Get /admin HTTP/1.1" 200 485 - -> /admin Subsequent browser calls to /Admin show: NoMethodError in AdminController#index undefined method `each'' for #<Mysql:0x37aba80> - And WEBrick reports: "Get /admin HTTP/1.1" 500 10767 - -> /admin First browser call to /Admin/new shows correct form for editing; - And WEBrick reports: "Get /admin/new HTTP/1.1" 200 10767 - ->...
2006 Apr 30
0
Role based auth recipe from a subfolder?
Hi guys, I have implemented the recipe for role based auth in the book, it works perfect(after sometime of pain to make it work fine), im using class inheritance to authenticate all the classes from one point(class AdminController in this case) i have this base structure: class AdminController < ApplicationController ... end class ArticlesController < AdminController ... end i define the following rights(by now i have only defined one role for easy implementation purpuoses) for the user: :controller :action a...
2007 Jun 11
2
Testing create in Rails controller
...) ... and have been trying to apply RSpec to the depot example in Dave Thomas'' book as I build the application. I am having a problem testing the admin controller create method and cannot quite see where I am going wrong so was hoping for a pointer :-) My spec looks like: describe AdminController do before(:each) do @product = mock("product") # Generally, prefer stub! over should_receive in setup. @product.stub!(:new_record?).and_return(false) Product.stub!(:new).and_return(@product) end it "should create a new, unsaved product on GET to new&quo...
2006 Mar 22
4
Problem with ACL plugin system
...#39;s ACL access control plugin. It''s working fine (in conjunction with acts_as_authenticated) until it comes across a user it denies access to, in which case it throws the following error: NoMethodError in Admin#index protected method `access_denied'' called for #<AdminController:0x408fc9a8> RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace ./script/../config/../vendor/plugins/acl_system/lib/caboose/access_control.rb:24:in `access_control'' The prob seems to be in the following code block: 23 if c.respon...
2006 May 14
2
Initialize, instance variable....wrong number of arguments!
...9; or ''Template is missing''. My 2 questions are: 1. Can anyone see what is wrong with my code? 2. Can anyone please give me some info or point me into the direction of where I can find info about instance variables, initialization for newbies like me? Thanks a lot, Alex class AdminController < ApplicationController ... def wipinput @job = Job.find(params[:id]) end def initialize(status) @status = status end def wipupdate if params[:save] and @status == ''WIP'' @job = Job.find(params[:id]) if @job.update_attributes(params[:j...
2006 Jan 04
6
Ajax makes me cry
...d list with id=form_results link_to_remote ("Help me please!", :update => ''form_results'', :url => { :action => :search_ajax_test }, :position => ''bottom'') with this log message Processing AdminController#search_ajax_test (for 192.168.15.100 at 2006-01-03 21:35:43) [POST] Parameters: {"action"=>"search_ajax_test", "controller"=>"admin"} Completed in 0.00079 (1272 reqs/sec) | DB: 0.00000 (0%) | 200 OK [http://192.168.15.50/admin/search_ajax_test] Thi...
2006 Aug 17
6
NameError in AdminController#index building scaffold
...create app/controllers/admin_controller.rb create test/functional/admin_controller_test.rb create app/helpers/admin_helper.rb create app/views/layouts/admin.rhtml create public/stylesheets/scaffold.css Looks like no problem, but then I check the page: NameError in AdminController#index uninitialized constant User RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing'' D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/activ...