similar to: Need help PLEASE!!! - updating collection from form

Displaying 20 results from an estimated 2000 matches similar to: "Need help PLEASE!!! - updating collection from form"

2006 Mar 09
3
problem with find()
I''m trying to update records in a table based on data I get back from a form. In the simplest case, the params structure returned from the form is: {"illness"=>{"1"=>{"illness_date"=>"", "qualifier"=>""}}} The controller code works (i.e., updates the first record) when I do the following: params[:illness].each do
2006 Jan 12
10
uninitialized constant error
Hi Everyone, I''m a newbie to Rails, and I just finished going through the cookbook tutorial. I''m now trying to build my own application, and I''m trying to add more inputs to the edit view to modify data in other tables. Below is the controller code where I am having trouble. PartsLocation is another table (like Part) in the database, and that is the line where
2006 Jun 26
3
syntax for observe_field( :with =>
Greetings! What is up with the syntax of this thing? I mean, if the only thing I can send back using :with is the field being observed, then why in the world is the syntax so convoluted? For example, what I''ve been able to get working is: <%= text_field_tag(''date'', illness_date, :size => 30) %></p> <%= observe_field(''date'', :url
2010 Aug 19
4
Aggregate Help
Please let me know if this is or is not the right place to ask these types of questions. Warning: I am new to R by two days. I have a simple dataset. I have loaded the dataset successfully using the following code: Filepath=(C:\temp\\pilot\dataset1.txt") Pilot=read.table(filepath, header=TRUE) Dataset1.txt is delimited and looks like this: Date illness count 2006/01/01 derm 17 2006/01/01
2007 Feb 20
1
error message for record not found ?
I''m using backgroundrb for session management and deletion of visitor-entered information when a session is abandoned. The visitor can either click a button to end their session and remove their data, or backgroundrb will do it for them after 5 minutes of inactivity. Everything''s working fine, I think. If the visitor explicitly logs out, then when the worker checks for their
2006 Mar 05
2
Need help understanding Rails magic!
Hi, I''ve just been pleasantly surprised, again, by how much Rails does for me, but I am *really* surprised. Surprised as in "how the heck did that happen?" I''d really like to understand this and would appreciate any help. Big picture... the user is presented with a form that allows them to select one or more check boxes to record their allergies. The form uses the
2005 Dec 31
7
Dynamic form? Not really!
Hi guru''s out there, Im happilly coding my first rails app, and all goes well. I find myself manually coding in a particular field all the time (company_id), that relates the contact to a company. The total coding of this form seems somewhat much. Could somebody tell me what Rails power I''m possibly missing and stuborn as I am trying to do myself? I was wondering if the
2006 Oct 17
6
Session access interfers with other model access
Sorry to be such a bother but I''m not getting this. I have two models: Emrec and Session (I''m using AR for session mgmt.) In my worker I can access the Emrec model and delete a record, AS LONG AS I don''t try to access the Session model. With the Session model access commented out as below, the Emrec record gets deleted. If I uncomment those lines, the Emrec
2006 Jun 25
4
Zebra Striping a Collection of Partials
I''m using render to display a collection of partials, where each partial is a table row. Is it possible to zebra-stripe the table using this method i.e. alternate table rows get a different CSS class? I can''t work out how each row partial would know whether it was odd or even. In the normal scheme of things I could do: <% odd_or_even = 0 for asset in @assets
2009 Oct 08
0
autospec cannont find gems
I am trying to install rspec for rails and have the following gems install C:\INSTAN~3.0-W\rails_apps\katai>gem list --local *** LOCAL GEMS *** actionmailer (2.3.4, 2.0.2) actionpack (2.3.4, 2.0.2) activerecord (2.3.4, 2.0.2) activeresource (2.3.4, 2.0.2) activesupport (2.3.4, 2.0.2) authlogic (2.1.2) autotest-rails (4.1.0) builder (2.1.2) capistrano (2.5.9, 2.1.0) cgi_multipart_eof_fix
2007 Jan 11
6
nil object while the required parameter are in the request
I''m having an application as follows. I have all the parameters for as object appended in the url. And there is an action in the controller like this def newlet render :layout=> false @product = Product.new if request.get? @product.title= params[:title] @product.description = params[:description] @product.primary_link = params[:primary_link]
2007 Jan 15
5
ActionController::UnknownAction (No action responded to xxx)
I have a new method defined in a existing controller. All the methods I called in these are workable. But somehow the new method is not recognizable. ------------------new method I added-------------------------------------------- def push # if fair begin @product = Product.find(params[:id]) rescue logger.error("Attempt to access invalid product #{params[:id]}")
2007 Jul 04
2
problems after gem update
Hi, I had ferret working wonderfully but i am regretting doing a gem update today. I had alot of trouble first installing it and was really happy to have it working. The upgrade was from 0.3.1 to 0.4.0. The problem is; in the rails console, >> @results = Book.find_by_contents("peter pan") => #<ActsAsFerret::SearchResults:0x487040c @total_hits=0, @results=[]> Its indexing
2007 Feb 12
1
Invalid char problem
Has the problem with corrupted .rhtmls (invalid characters) been solved so far? I would like to use ferret and acts_as_ferret on Windows XP. I have installed 0.10.9 (mswin32) which still seems to have the problem. I am receiving error messages like: compile error C:/INSTAN~1.4P1/INSTAN~1/rails_apps/travelogue/config/../app/views/article_editor/_header_read.rhtml:2: parse error, unexpected
2006 Sep 09
2
Server-side session management for short session expirations?
I need to effectively log a user out if their session is inactive for more than a short period of time, like 5 minutes. I need some help understanding how to approach session expiration and cleanup in Rails. When the user explicitly logs out of my app, I delete all the data they''ve entered/that''s been created during their session. The data includes files, database records, and
2006 Mar 27
0
update subset of my data
Please can someone put me out of my misery... I am missing the point here: I have a table of albums called: dealers I have a table of images: popp_images each dealer has 6 popp_images linked by foriegn key: albumid Each dealer can login using user_engine engine I restrict viewing for each dealer to their own images by assigning each dealer their own albumid. I list their images with: in my
2006 Feb 15
0
Confused by this error when trying to use ''pagination''
Trying to create stuff without resorting to scaffold command. I have a list view in my login_controller.rb file... def list_users @user_pages, @users = paginate :users, :per_page => 14 end I have a command in my list_users.rhtml file which undoubtedly calls this pagination... <% odd_or_even = 0 for user in @users odd_or_even = 1 - odd_or_even %> and instead of being presented a
2006 May 25
1
AppMailer and McCray''s theme generator
Hi, I am using Matt McCray''s theme generator. http://rubyforge.org/projects/theme-generator/ Everything works fine, but rendering an action in a controller using the AppMailer raises this: undefined method `current_theme'' for #<AppMailer:0x39df950> Is there someone who could help me ? Thanks ! Mickael. Traces:
2006 Feb 25
7
Help with DRY: too much code in my view
I''m a newbie to rails, and really to the whole DRY and MVC thing as well, except where I accidentally fell into things doing it my own way in the past. I''ve got a fairly complex DB structure I want to create an interface for using Rails. Getting simple tables to display, edit, save, not too much problem there. But where I''m having trouble is figuring out where to
2009 Feb 21
1
undefined method user_id
Basically, Im trying to add comments to photos that other users have uploaded. And Ive encountered an error: NoMethodError in CommentsController#create undefined method `user_id='' for #<Comment:0x4768cd0> C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1857:in `method_missing''