search for: userscontroller

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

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'...
2008 Jun 04
5
controller filters running twice in 1.1.4?
....rb: before_filter :foo def foo "foo" end and an example in users_controller_spec.rb: it "should call foo via a before filter" do controller.should_receive(:foo) do_get end results in this: 1) Spec::Mocks::MockExpectationError in ''UsersController handling GET /users.xml should call foo'' Mock ''UsersController'' expected :foo with (any args) once, but received it twice script/spec:4: Is any one else seeing this? Thanks, Matt -- View this message in context: http://www.nabble.com/controller-filters-running-twice-i...
2014 Mar 24
0
"class Admin::UsersController < ApplicationController". What does the double colon do here?
I saw this on a Gem implementation and don't understand why it needed "::UsersController" at all. My understanding that it is trying to find the relative path of UsersController, but why is it necessary to be there? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receivi...
2010 Feb 25
9
uninitialized constant UsersController::User
i just created an application to list the primary details of userbut it is showing an error lik this "uninitialized constant UsersController::User" this is my controlller class UsersController < ApplicationController puts"hiiiiiiiii" def index puts"hiiiiiiiii" @users = User.find(:all) puts @users respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end...
2009 Sep 30
1
2 RESTful controllers for the same resource
Hi everyone I want to have two restful controllers for the same resource (Users) One controller (UsersController) is straight in the controllers folder and is used for singup and so on Then i need another controller for users which is inside an admin folder (Admin::UsersController) In my routes.rb i have map.resources :users # Sample resource route within a namespace: map.namespace :admin do |admin...
2014 Apr 17
0
RestClient::ResourceNotFound in UsersController#index
Hi, I am trying to implement Rest Api for a sample application for learning purpose. But when I try to make a "GET" request through the RestClient it is showing error as RestClient::ResourceNotFound in UsersController#index def index uri = "#{API_BASE_URL}/users.json" # specifying json format in the URl rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD) # It will create new rest-client resource so that we can call different methods of it users = rest_resource.get @us...
2010 Jul 13
1
NoMethodError in UsersController#show
So I am getting the error NoMethodError in UsersController#show error undefined method `feed'' for nil:NilClass {"authenticity_token"=>"zalkdfsjfksjd;lfs;lfksdkf/2tPzo=", "login"=>"session", "password"=>"admin", "commit"=>"Log in"} Why is login being set t...
2009 May 01
4
Can't get to an action in a RESTful controller
Folks, I am using the restful_authentication plugin. This creates the users controller which is declared as a resource in routes.rb as below map.resources :users Now in the UsersController I have created an action to resetpwd that I am trying to get to from the login page when the user clicks "forgot password". However, when I do that the log file tells me that the call to /users/resetpwd gets resolved to the "show" action of the controller with id="resetpwd&...
2011 May 17
6
Nested Resource w/ Collection
...utes file I have the following nested resource: resources :users do collection do get ''posts'' end end However, when I visit this URL: http://localhost:3000/users/posts, I get this error: "The action ''posts'' could not be found for UsersController" In my UsersController I have the following: class UsersController < ApplicationController # GET /users # GET /users.json def index @users = User.order(:name) respond_to do |format| format.html # index.html.erb format.json { render :json => @users } end...
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'' users_controller.rb # PUT /users/1 # PUT /users/1.json def update @user = User.find(params[:id]) respon...
2011 May 06
3
Rails 3 Routing problems
I have an UploadsController and UsersController where Users'' has_many :uploads'' via polymorphic attachment in uploads.rb. Now we i navigate to http://localhost:3000/users/1/uploads I get re-routed to Uploads#index and rendered is called multiple times as shown below: Started GET "/users/1/uploads" for 127.0.0.1 at...
2007 Nov 14
6
My own methods on model + "extends" problem?
Hello. I have a UsersController and a Model called User with a "new" method, like this: class User < ActiveRecord::Base def test return 1 #I can do anything and return any data, the problem continues. end end The problem is that I cannot access my "test" function from the controll...
2011 Jul 19
0
Ruby on Rails Tutorial Chapter 8 Signup Success
I have written the Users controller and Spec tests correctly for the "successful creation" in the User controller however I get the following two errors: 1) UsersController POST ''create'' success should create a user Failure/Error: lambda do count should have been changed by 1, but was changed by 0 # ./spec/controllers/users_controller_spec.rb:95:in `block (4 levels) in <top (required)>'' 2) UsersControlle...
2010 Nov 30
4
Cucumber+Capybara rails 3 issue (Don't know where exactly)
...al the same requests (GET or POST) usually around 3, and it doesn''t render anything with empty HTTP status code. Have anyone met something similar to that issue? here is some example of log file: Started POST "/account" for 127.0.0.1 at 2010-11-30 22:34:17 +0200 Processing by UsersController#update as HTML Parameters: {"_snowman"=>"☃", "user"=>{"person_attributes"=>{"first"=>"First", "last"=>"Last", "id"=>"1061"}, "email"=>"ivan2-hcDgGtZH8xNBDgjK7y7T...
2007 Jul 24
6
Mocking Access Control
I''m trying to jump on the TDD/BDD bandwagon, but am having trouble understanding how i should mock my user. The user has a habtm relationship to a roles model (acl_system2 plugin), but I''m not sure how to tell rspec about a model. My code: describe UsersController do integrate_views before(:each) do @user = mock_model(User) @user.stub!(:new_record?).and_return(false) @user.stub!(:id).and_return(666) @user.stub!(:email).and_return("john at doe.com") @user.stub!(:password).and_return("dummypassword") User.stub!(...
2008 Oct 20
5
RSpec-Rails bug with to_xml?
...-1.1.8 and rspec-rails-1.1.8, all installed as gems. I started by creating a dead-simple model with two string attributes and no validations, along with this fixture: # spec/fixtures/users.yml one: name: Name email: email Then I created a simple controller, and its corresponding spec. class UsersController < ApplicationController def index respond_to do |format| format.xml { render :xml => User.find(:all).to_xml} end end end # spec require File.expand_path(File.dirname(__FILE__) + ''/../spec_helper'') describe UsersController do fixtures :users it &q...
2007 Dec 04
10
Unexpected message on :attr_accessor
...@user.should_receive(:password_confirmation) get ''edit'', :id => @user.id end I am asking it to expect that I will be assigning something to that attribute in the "edit" method. Unfortunately, the spec fails with Spec::Mocks::MockExpectationError in ''UsersController should find User on GET to users/edit/:id'' Mock ''user'' received unexpected message :password_confirmation= with ("password") Initially I thought that my "should_receive" expectation was incorrectly written, but if I comment out the attribute assignmen...
2011 Jun 12
3
Problem with undefined variable current_user
...ng something I''d appreciate it if someone with more experience at debugging could point me in the right direction. I can sign in with my test users and the exception only occures when attempting to edit a profile. Controller and model are attached. Cheers, Jen. Error: NameError in UsersController#edit undefined local variable or method `current_user'' for #<UsersController:0x9ffad80> |Rails.root: /home/resource_portal/website| Application Trace <http://localhost:3000/users/1/edit#> | Framework Trace <http://localhost:3000/users/1/edit#> | Full Trace <http:/...
2010 Sep 19
4
Rails 2.3.8 - InvalidAuthenticityToken problem. URGENT!
I used to have Simple Captcha installed, but since I removed it I got all kinds of problems with login. Processing UsersController#login (for 188.177.122.179 at 2010-09-19 12:21:09) [POST] Parameters: {"commit"=>"OK", "authenticity_token"=>"/ Y0aZETCsMhyI3CkrZJK6O2NaLEoi+LRe8ZuDPWU9kc=", "user"=>{"remember_me"=>"0", "password"=>&qu...
2008 Jan 23
2
integrate_views is not executing my views
...ecuted I looked everywhere but I can''t understand what I am doing wrong. Here is what I did: I created a new application from scratch (Rails 2.0.2), added rspec and rspec_on_rails plugins, and run script/generate rspec_scaffold User name:string This is my users_controller spec: describe UsersController do fixtures :users integrate_views describe "handling GET /users" do it "should be successful" do get :index response.should be_success end end end I then added something wrong (on purpose) in index.html.erb (<% WRONG %>) so that when I visit...