similar to: Creating collections

Displaying 20 results from an estimated 4000 matches similar to: "Creating collections"

2006 Aug 07
8
Login form question
I''m using Rails Recipes to create a login form but instead of username and password, my setup is firstname, lastname, password. I seemed to be gramatically challenged and not sure how to set up the parameter list. Can anyone offer up a suggestion. The book shows the method starting like: if request.post? user = User.find(:first, :conditions => [''username = ?'' ,
2006 Feb 07
3
Newbie help ..
Hi .. I am new to Rails and it is not clear to me why I am getting the following error. Any help appreciated. -m. $cat app/views/admin/new.rhtml <% @page_title = "New member..." -%> <%= start_form_tag( :action => ''create'' ) %> <table> <tr> <td> First Name: </td> <td> <%= text_field(
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in the browser. <h1>New member</h1> <%= error_messages_for :member %> <% form_for(:member, :url => members_path) do |f| %> <fieldset> <legend>Member Info</legend> <p><label for="member[first_name]">First Name:</label> <%=
2006 Jun 23
3
form_remote_tag is not passing form params
I''ve searched and searched and searched again, and I cannot find any help with this problem. There''s an identical problem on this forum, but it was never resolved. I''ll try to re-open the subject with a bit more information. Problem: The form_remote_tag() method in my "list" view is not passing the params[] hash of the values stored within my form.
2006 Aug 03
5
Rails - forms
Currently I have a registration form that is built like this: <label for="First name">First name</label> <%= text_field "user", "first_name" %><br> <label for="Last name">Last name</label> <%= text_field "user", "last_name" %><br> <label for="Email">Email</label>
2006 Feb 03
9
Because I''m very slow - trying to use console
I can''t see how to use variables so I am using console to test things out... clients table - a column named first_name My very brief console session... >> clients = Client.find_by_sql("select * from clients where first_name = FN") ActiveRecord::StatementInvalid: RuntimeError: ERROR C42703 Mcolumn "fn" does not exist Fparse_expr.c L1034
2007 Sep 20
2
Rendering a partial from within that partial
I am having trouble rendering a partial called ''names'' through a submit tag located within that partial. The form data is saving with my current code. However, the existing data is not loading into the form and the partial is not being re-rendered upon submission to reveal the changes to this data.What might I do to fix this? show.rhtml <%= javascript_include_tag :defaults
2005 Mar 09
8
How to set ''Return-Path'' in ActionMailer to avoid SPF failure?
I was wondering if there was any way to set the ''Return-Path'' of an email when using ActionMailer. Without the ability to set the ''Return-Path'' of an email, it is impossible to avoid being labeled as ''spam'' by many SMTP gateways if trying to send mail on another''s behalf. SPF doesn''t care about the
2006 Jul 30
2
options_from_collection_for_select & multiple columns
I have a table with first_name and last_name, and wan''t to populate a drop-down with the id and the person''s name consisting of the first and last names concatenated together. Can''t figure out how to tell options_from_collection_for_select to do that. Any ideas? I basically need to do something like: <%= options_from_collection_for_select @media_creators,
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work. My controller(relevant parts) looks like def configure @account = session[:account] @user = User.new end def add_new_user_to_account @user = User.new(params[:user]) if @user.valid? session[:account].users << @user end redirect_to :action=> ''configure'' end end and my
2009 Aug 27
8
Adding New Column
I added a new column using a migration. Once I updated the new.html.erb, edit.html.erb, show.html.erb, and the index.html.erb I brought up my web pages. There was a field to update show. I tried the update and the it was successful but the update did not show up in any of the other pages. What did I miss? I am using 2.3.3 of ror.
2011 Jul 14
10
Devise confusing routes
I had a similar problem yesterday. I would go to the root of my site and I would get a Too Many Redirects message. It seems like there was an infinite loop. After struggling for over an hour yesterday late at night, it seemed like I fixed it. But now, when I want to create a New User, it''s redirecting me to the Sign In screen. Seems like I didn''t fix the problem completely. I
2006 Feb 21
8
Validations continued
I simply can''t figure this out. I have been reading and re-reading Agile book and wiki.rubyonrails.org - all sorts of validation methods and still, it doesn''t work. Controller code def create @client = Client.new(params[:client]) if @client.save! flash[:notice] = ''Client was successfully created.'' redirect_to :action =>
2006 Jan 25
7
join fields for list views
I am sitting with the Agile book on my desk and scratching my head at the discussion on aggregation - perhaps that isn''t what I need. I have a db called clients. fields include - first_name middle_initial last_name I want to combine them all into one name element in a list view. I can add/edit the fields separately but in the list view, I only want the one combo field. Is there a
2007 May 30
4
aaf and dynamic attrs: a bug?
Hi! I faced some issue while using it for dynamic attrs indexing/search. Maybe I made something wrong. Here is test method. Everything works just fine until last line http://pastie.caboo.se/66274 . Tested on both stable and trunk of aaf and ferret 0.11.4. the short version of code below: Contact.acts_as_ferret :fields => [ :first_name ] assert
2006 May 17
5
text_field_with_auto_complete (newbie question)
I have the text_field_with_auto_complete woking on my user DB using last_name. so looking for ''ivanoff'' works great, but I can''t find ''john''. Plus I like to have ''last_name, first_name'' show up in the dropdown. what I can''t figure out is how to concat first_name and last_name to make a name and use that to look it. working
2006 Aug 07
3
wrong number of bind variables
I''m getting this error message since i moved alot of the database logic to the model. wrong number of bind variables (0 for 2) in: first_name = ? AND last_name = ? def self.authenticate(first_name, last_name, password) user = User.find(:first, :conditions => [''first_name = ? AND last_name = ?'']) if user.blank? Digest::SHA256.hexdigest(password +
2005 Mar 08
1
Adding to model (newbie)
Sorry if this is a really lame question, I''m sure it''s something fairly obvious, but I just can''t see it at the moment... I''m trying to add something simple to the model for a project management/todo list/thing. The DB has ''first_name'' and ''last_name'', and I''d like to have "full_name" available. So -
2006 Jan 08
1
Options_from_collection_for_select -> Multiple fields in display
The following code shows a list of the users, with username being each person''s initials (mine would be DM). &lt;%= options_from_collection_for_select @users,"id","username" %&gt; However, I''d like to have the display of the SELECT box be "DM - Dylan Markow" instead of "DM." Is this possible using
2006 Aug 07
2
Bind variables error
wrong number of bind variables (0 for 2) in: first_name = ? AND last_name = ? I''m not sure why I"m getting this error ? def self.authenticate(first_name, last_name, password) user = User.find(:first, :conditions => [''first_name = ? AND last_name = ?'']) if user.blank? Digest::SHA256.hexdigest(password + user.password_salt) != user.password_hash