Displaying 20 results from an estimated 53 matches for "users_control".
Did you mean:
ser_control
2006 Apr 16
6
sorting
I need to sort users by their rank how do I do this?
--
Posted via http://www.ruby-forum.com/.
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])
respond_to do |format|
if @user.update_attributes(params[:user])
format.html { red...
2006 Apr 10
3
Problems with multiple ActiveRecords and Validations
...ce
again. But all the checkboxes are unchecked!
I haven''t been able to figure out what exactly does happen in case a
validation fails, although I have screened the source code of the
ActiveRecord and ActiveView classes and come across the magic errors
object.
Here some source code:
users_controller.rb:
def edit
@user = User.find(params[:id])
@visibility = @user.visibility
end
user.rb
class User < ActiveRecord::Base
validates_presence_of :lastname, :firstname
has_one :visibility
end
edit.rhtml (excerpt)
<%= text_field ''user'', ''lastname''...
2014 Mar 01
0
Rails controller problems
1. Users_Controller CRUD expects param[:id] to create User instance. With
Orders_Controller, I'd like to retrieve a list of users who have ordered. I
know Orders_Controller expects param[:id] to be for creating Order
instance. So does this mean if I want to retrieve a list of users who have
ordered, I shoul...
2010 Jul 06
4
Simple routing problem
I''ve got the following in config\routes.rb:
map.resources :users
In app\views\shared\_menu.erb, I''ve got:
Please sign in <%= link_to
"here", :controller=>"user", :action=>"sign_in" -%>
In app\controllers\users_controller.rb
def sign_in
end
When I run the application, I crash with:
Routing Error
No route matches "/user/sign_in" with {:method=>:get}
I presume I should add "def sign_in; [snip]; end" somewhere in:
app\views\users
But where, so as to satisfy the Rails routing scheme?
Is...
2009 Jan 26
5
Please help with a routing problem
Hi All
I''m having some issues with the following routes problem.
The routes.rb file ...
map.resources :users
map.connect ''/users/view_payments/:user_id'', :controller =>
''users'', :action => ''view_payments''
The users_controller.rb file ...
def view_payments
@user = User.find[:params[:user_id]]
@payments = @user.payments
end
The routes list from a rake routes ...
/users/view_payments/:user_id
{:controller=>"users", :action=>"view_payments"}
The .../views/users/view_payments.h...
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 => "json", :locals =>
{:user => @user})
#notice, that redirect_to was reinitialized and :text is...
2013 Oct 24
6
undefined method `paginate' for #<Class:0x567eb98> in Rails Tutorial
Hi,
I''m getting a undefined method `paginate'' for #<Class:0x567eb98> even
though I have gem ''will_paginate'' installed.
Inside the users_controller I have @users = User.paginate(page: params[:page
])
so I believe I set everything up to be correct.
Can you figure out why the method''s undefined, despite installing the gem?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g...
2011 Jun 12
3
Problem with undefined variable current_user
...s.root: /home/resource_portal/website|
Application Trace <http://localhost:3000/users/1/edit#> | Framework
Trace <http://localhost:3000/users/1/edit#> | Full Trace
<http://localhost:3000/users/1/edit#>
|app/helpers/sessions_helper.rb:17:in `signed_in?''
app/controllers/users_controller.rb:91:in `authenticate''
rake-0.8.7/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:436:in `_run__1056153724__process_action__372525482__callbacks''
rake-0.8.7/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:409:in `_run_process_action_call...
2013 Oct 21
6
I think I've found a mistake in Rails tutorial
...up_failure>
clicking the "Create my account" button on the signup form shows the
following image at
<http://ruby.railstutorial.org/images/figures/signup_failure_rails_4.png>
According to the tutorial, I must modify these files to rid myself of the
error.
- app/controllers/users_controller.rb
- app/views/users/new.html.erb
- app/views/shared/_error_messages.html.erb
- app/assets/stylesheets/custom.css.scss
I made all the modifications (until I saw the *working image*<http://ruby.railstutorial.org/images/figures/signup_error_messages_bootstrap.png>to the 4 files...
2010 Aug 10
2
undefined method `has_many' for Object:Class +Savage Beast 2.3 plugin
...#39;
C:/forum/vendor/plugins/savage-beast/lib/savage_beast/user_init.rb:
7:in `class_eval''
C:/forum/vendor/plugins/savage-beast/lib/savage_beast/user_init.rb:
7:in `included''
C:/forum/app/models/user.rb:2:in `include''
C:/forum/app/models/user.rb:2
C:/forum/app/controllers/users_controller.rb:16:in `create''
please help me to resolve this problem.
Thanks
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.o...
2008 Dec 16
3
Princely Plugin: get nil.size error
...it!
You might have expected an instance of Array.
The error occurred while evaluating nil.size
RAILS_ROOT: /var/www/sortapp
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/streaming.rb:123:in
`send_data''
app/controllers/users_controller.rb:135:in `pdf''
I also used make_and_send_pdf function but got the same error.
I thought I am getting error in render_to_string function.
Can anyone tell me how can I solve this issues?
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~-----------...
2013 Aug 21
3
syntax error, unexpected tRPAREN raised in server log
....0.0/lib/active_support/callbacks.rb:374:
syntax error, unexpected tRPAREN
2013-08-12T23:06:08.932580+00:00 app[web.2]:
2013-08-12T23:06:08.932580+00:00 app[web.2]: def () value = nil
2013-08-12T23:06:08.932580+00:00 app[web.2]: ^):
2013-08-12T23:06:08.932580+00:00 app[web.2]:
app/controllers/api/users_controller.rb:42:in `show''
2013-08-12T23:06:08.932580+00:00 app[web.2]:
2013-08-12T23:06:08.932580+00:00 app[web.2]:
Any idea what would have caused it?
The code I have looked like this:
@user =
User.with_clients.with_projects.find(doorkeeper_token.resource_owner_id)
I cannot reproduce this b...
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 whole site uses one layout: application.rhtml.
The problem is if there is an error in registration process, for
example a validation error, the errors...
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
map.namespace :admin do |admin|
admin.resources :u...
2006 May 27
2
NameError / active_support/dependencies
...s.rb:100:in
`const_missing''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
`const_missing''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
`const_missing''
#{RAILS_ROOT}/app/controllers/users_controller.rb:168:in `signup''
note: the User model is used for logingenerator (login_system) gem
i have no clue what is going on. the table Users exists in my db. ????
thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 17
2
Validation not working.......
..."login")%>
<%=text_field("user", "name", "size" => 20)%>
<%=password_field("user", "password", "size" => 20)%>
<%= submit_tag %>
<%= end_form_tag %>
------------------------------------------
-----users_controller.rb-----------------
def login
@user = User.new(params[:user])
redirect_to :action => ''list''
end
def new
@user = User.new
end
-----------------------------------------
------user.rb----------------------------
class User < ActiveRecord::Base
validates_pr...
2008 Jan 23
2
integrate_views is not executing my views
...to work: the view code in not executed
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 (<...
2007 Jul 23
2
Firebird, fireruby
...ctive_record/
base.rb:1101:in `construct_finder_sql''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:997:in `find_every''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:418:in `find''
#{RAILS_ROOT}/app/controllers/users_controller.rb:13:in `index''
Please advice.
thanks
Ajit Singh
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5...
2005 Oct 25
2
generate scaffold ignores controller parameter
...test/unit/user_test.rb
create test/fixtures/users.yml
create app/views/users/_form.rhtml
create app/views/users/list.rhtml
create app/views/users/show.rhtml
create app/views/users/new.rhtml
create app/views/users/edit.rhtml
create app/controllers/users_controller.rb
create test/functional/users_controller_test.rb
create app/helpers/users_helper.rb
create app/views/layouts/users.rhtml
create public/stylesheets/scaffold.css
Note - I''m new to Rails and it''s quite possible I''m doing something wrong.
T...