Displaying 20 results from an estimated 600 matches similar to: "Exception: can't dup Symbol"
2012 Apr 25
8
showing error (gsub) when switching from session to cookies
I am newbie to rail. Trying to develop social networking site so working
with railspace application. Everything is working fine but I stuck in
the problem when i am giving the authorization tocken to the user to
remember him/her.
My Error and controller code is below
Error:-
private method `gsub'' called for 4:Fixnum
C:/Users/Amir/Downloads/IR/ruby/lib/ruby/1.8/cgi.rb:342:in
2010 Aug 14
10
Redirecting after logging in
Hey everybody,
I''m trying to make an example of a small networking site, and when I log
in a user, it should redirect and show his profile, but I get the
following error:
NoMethodError in User#index
Showing app/views/user/index.html.erb where line #5 raised:
undefined method `screen_name'' for nil:NilClass
Extracted source (around line #5):
2: Your basic information
3:
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file.
class UserControllerTest < ActionController::TestCase
fixtures :users
def setup
@controller = UserController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@invalid_user = user(:invalid_user)
@valid_user = users(:valid_user)
end
def test_login_success
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=",
2009 Apr 29
7
problem with nil.user
Hi all, I''ve put new code into my app so that an administrator will have
extra privileges (administer users, edit pages). The error is:
''Couldn''t find User without an ID''
So the app is looking for a logged in user when the homepage is
accessed.
Heres my code:
site/index view:
<% if is_logged_in? and logged_in_user.has_role?(''Moderator'')
2010 Jul 31
5
date_select Year as a text_field
Hey all,
Using date_select in a form, how can I make the Year field a
text_field instead of a select? It looks like it will take more than a
simple modification of the date_select method.
Thanks in advance.
Cam
--
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
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
In console, I am trying to create a User but the :account_id does not come
in. Console just gives me back :account_id => nil. Obviously I''m trying to
set it though. Silly console...
But, I can set the account_id column in my controller like so:
@user = User.new(params[:user])
@user.account_id = account.id
@user.save
Here''s what I give to the controller:
User.create :name
2006 Jun 16
2
Problem with User Login from Agile Web Development
I am trying to use an expanded version of the User Login from the Agile
Web Development with Rails book. It takes the user name and password
but then says "Invalid user/password combination". Looking at the log
everything seems to be fine until it sends the query to MySQL. The
query shows that the name is '''' instead of the name that was passed to
the self.login
2007 Dec 17
14
Change in isolation behaviour 1.08 - 1.10 ?
Hi,
I just moved from 1.08 to 1.10 and now have one example failing, which,
under 1.08, passed. Is the due to a change in behaviour?
Here''s my spec (removed some passing examples)
require File.dirname(__FILE__) + ''/../spec_helper''
describe "A user" do
before(:each) do
@user = User.new
@valid_user = User.new(
:email =>
2011 Jan 17
4
Factory Girl and attr_accessor with validation
I have a problem with a recent change to one of my models when created
via Factory.create.
class User < ActiveRecord::Base
attr_accessor :tc_check
validates :tc_check, :presence => true, :acceptance => true
...
end
The following definition fails, when calling
Factory.create(:valid_user)
Factory.define :valid_user, :class => User do |u|
u.email
2018 Sep 19
1
Sieve and output variable for execute
I'm trying to get blow Sieve filter to work
require ["fileinto", "imap4flags", "mailbox", "body", "envelope", "vnd.dovecot.pipe", "variables", "vnd.dovecot.execute"];
if envelope :matches "To" "*@*" {
set "recipient" "${0}";
set "user" "${1}";
set
2006 Feb 06
1
Check, and display, AIM status on rails page
Thought I''d post this in case it''s of use to anyone. Maybe even a recipe?
It''s just some simple helpers to show AIM status on a webpage.
I searched before coding it, and didn''t find anything similar.
Maybe that''s because it was so simple :)
These methods belong in a helper (such as app/helpers/application_helper.rb)
# begin AIM helper methods
def
2008 May 09
4
Validating Uniqueness From Two Database Tables?
Well, I''m working on adding a new type of user (organization) to my
application, using a different database table than the standard User
table (in the end, I think it works out being easier to deal with than
creating another column in the original User table for account type).
However, I''m running into a user registration problem. I can register
both types of users fine,
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and
often do: rake load_fixtures...
... in order to populate my development database with fun data.
Now, with any HABTM relationship, there are failures, as there is no way to
say "which" fixtures to load first.
Within an actual functional or unit test case, you could simply load them in
the proper order, but
2010 Jul 25
0
Testing problems: ActiveSupport
Hey everybody,
I am trying to test a small application with a simple testing, but I get
the following errors while using Aptana 2.0.5 with Ruby 1.9.1 and Rails
2.3.8(I know why I get the first one, but I''m not sure about the
ActiveSupport errors):
Exception: undefined method `screen_name'' for nil:NilClass
2009 Sep 12
3
Cannot get my password to validate
Hello,
I am working through the railsspace tutorrial, and i''ve noticed that
the password validation is no longer working.
I can get screen_name and email to validate, but for some reason, the
password field is ignored...
here''s what i have so far:
within user.rb file
PASSWORD_MIN_LENGTH = 4
PASSWORD_MAX_LENGTH = 40
validates_length_of :password, :within =>
2007 Dec 06
2
passing parameters through link_to
Is it possible to pass parameters through link_to that will be used by
the controller that link_to directs to? Specifically I have this
code:
<% for user in @users -%>
<%= link_to user.screen_name, {:action => "index", :controller =>
"users", :user_id => user.id } %>
<% end %>
Is it possible to use the parameter at the end of link_to(:user_id
2011 Jan 24
11
Can't get login to work
Hi, could anybody help me try to get a login function working, I have
created a database for users called user1, I have the login screen set
up but when i hit login with a correct username and password, nothing
happens
I am expecting the lgin button to direct the user to the main page and
show the user as logged on, but nothing happens! Thanks!
Controller
class User1Controller <
2010 May 25
2
Rails 2.3.6 and Authlogic 2.1.4 or 2.1.3
In the test environment, logging out and back in is not working for me. The
log for the first login looks like this:
Processing UserSessionsController#create (for 127.0.0.1 at 2010-05-24 19:53:57) [POST]
Parameters: {"user_session"=>{"remember_me"=>"true", "password"=>"[FILTERED]", "login"=>"test"},
2008 Jul 07
3
How to get a users screen name into a hidden field in a PostsController action?
Instead of the user entering a name, I want to pass their screen name
along with supplied :title and :content fields. here is what I''ve
got..
f.hidden_field :author, user.screen_name
here is the create method from Posts controller:
def create
@title = "Gravity"
@user = User.find(params[:id]) # this does not work, and I don''t
know why
if request.post?