similar to: Fixtures and Relationships

Displaying 20 results from an estimated 300 matches similar to: "Fixtures and Relationships"

2010 Jul 31
4
Exception: can't dup Symbol
Hey everybody, I''m trying to test a little piece of code I wrote, and I get the following error: Exception: can''t dup Symbol It happens in the following line: try_to_login @valid_user, :remember_me => "1", where the function try_to_login is: def try_to_login(user, options = {}) user_hash = {:screen_name => user.screen_name, :password => user.password}
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,
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 =>
2020 Jan 21
2
imap panic: file array.c: line 10 (array_idx_modifiable_i)
Hello, I just migrated a few dovecot IMAP mailbox (Maildir format) from a Dovecot 2.1.7 (Debian 7) mailbox server to a Dovecot 2.3.4 (Debian 10) mailbox server and one particular mailbox does not work properly and generates the following error log entries: Jan 21 09:39:21 Panic: imap(EMAIL_ADDRESS)<7741><UTsrWKKcasoAAAAAAAAAAAAAAAAAAAAB>: file array.c: line 10
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:
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
2020 Jan 27
3
imap panic: file array.c: line 10 (array_idx_modifiable_i)
Hello, Does anyone one have any idea? Aki maybe? Regards, Mabi ??????? Original Message ??????? On Wednesday, January 22, 2020 11:37 AM, mabi <mabi at protonmail.ch> wrote: > Hello, > > Are there any chances that I could fix this issue by running a "doveadm force-rsync" (https://wiki2.dovecot.org/Tools/Doveadm/ForceResync) on this problematic mailbox? > > Best
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 <
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
2006 Jan 30
5
Action Mailer woes
Hi gang, Im having my first stab at ActionMailer and not having any luck. Perhaps someone could help me out. I generated a a mailer called ItemMailer - its purpose is to take some information that I''ve already gathered in a ToDo list form and to mail it out to the person who is nominated for the task In environment.rb I have; ActionMailer::Base.server_settings = { :address =>
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?
2006 Feb 21
0
How do you order fixtures within each yml file?
Hi. I''ve come across the following documentation: Note that YAML fixtures are unordered. If you want ordered fixtures, use the omap YAML type. See yaml.org/type/omap.html for the specification. You will need ordered fixtures when you have foreign key constraints on keys in the same table. This is commonly needed for tree structures. Example: --- !omap - parent: id:
2011 Jul 15
3
Ruby variable that embeds html tags
This seems very simple, but I can''t quite get it. Probably because I''m just starting out with RoR. My view has a slew of labels and text fields; many are "required": <%= f.text_field :screen_name %> <span class="required_field">Required field</span> (The "required_field" class turns the text red and smaller.) I''d like to
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=",
2006 Mar 14
4
validates_confirmation_of has stopped working
Hi Railers, I''m past considering myself a noob in Rails land - I think what I''m up against here is more of a bug or an anomaly that I''m unaware of (or that has changed in a recent version). I had a fully working validates_confirmation_of :email_address field in my app - was one of the first things I set up, extremely simple, been working for a long time. Then one
2007 Feb 01
6
Using a nonstandard foreign key
Hopefully this is an interesting question. I have a "user" table with a field "email_address". I would like the part of "email_address" after the ''@'' to be a foreign key to a "companies" table populated by a companies that are clients. Any pointers on how to do this in rails? --~--~---------~--~----~------------~-------~--~----~ You
2006 May 19
2
Problem with joins and overlapping field names
Hi, I have the following code: @conversation_pages, @conversations = paginate(:conversations, :per_page => 20, :joins => ''LEFT JOIN messages on messages.conversation_id = conversations.id ''+ ''LEFT JOIN email_addresses on
2006 Oct 24
1
converting from courier questions
I currently run postfix and courier on my mail servers with squirrelmail. The problem with courier is it seems to run so slow. The webmail takes forever to load if you have many mails. I have this set up in virtual domains with all longin and path info in an mysql database. I just joined the list and DID google before asking, hope this isn't a common question. With courier it looks for a
2007 Feb 20
4
Best way to implement syntax sugar?
Hi! I''m *very* new to rails, I just dove in about a month ago and I''m loving it. One thing I decided I immediately wanted to do, was shorten the number of keystrokes neccessary to URI, HTML, or Jscript encode something. The project I''ve come into already has helpers defined for this. Right now, what I''ve done is: alias h! string_esacpe_html alias u!