similar to: Mapping contained objects to forms?

Displaying 20 results from an estimated 2000 matches similar to: "Mapping contained objects to forms?"

2006 Jan 19
3
problems with migrations in sql server
Is anyone using migrations with a SQL Server database who might be able to lend me a hand? I''ve used migrations with MySql in the past and haven''t run into any issues so forgive When I run rake migrate nothing is actually getting updated in my database. I created a migration using ./script/generate migration AddFooTable and updated the migration to look as follows: class
2006 Jun 30
6
RSS::Parser Documentation
Hi I am trying to use the RSS classes from "rss/2.0" and everything works but I want to know what attributes and properties I can get at from each of the classes I am getting back. For example, the class has a "channel" which I can tell has a "title" attribute (because it works when I query it :) but I would really like a list of every attribute that is
2006 Aug 18
3
setting a value of text_field from a controller
Hi, I need to set up an initial value from controller. In my views I''ve something like <%= text_field "object", "name" %> and would like to do something like this from controller def index @object[:name] = ''default value'' end but still got an error. Object doesn''t have database model (and will not have) Thank you PS: now using
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2006 May 23
3
image_tag problem
Hiall, I want to make an image_tag from within a controller in order to be able to present a link (with a status image) in a view. Here is my controller method (in file webca_controller.rb, hence WebcaController) def untouched_status_image_tag image_tag("open", { :alt => "Offen", :title => "Offen", :size => "12x12", :class =>
2008 Mar 06
1
Unitialized constant ActionView::Helpers::TagHelper::Set
Hi all, I write the following test to a simple plugin require ''rubygems'' require ''test/unit'' require File.dirname(__FILE__) + ''/../lib/meta_tags'' require ''action_view/helpers/tag_helper'' class MetaTagsTest < Test::Unit::TestCase include MetaTagHelper include ActionView::Helpers::TagHelper .
2009 Aug 12
5
Challenge for object_id, Garbage Value
I am facing strange problem. I have an object @part=MainPart.find(:all) 1. @part.each_with_index do |mainpart,index| 2. <p><%= mainpart.object_id%></p> 3. end Here problem is that object_id is reserved for rails. Here object_id field in my table . Now i want to get value <%= mainpart.object_id%> is giving GARBAGE VALUE. Is there any solution apart from
2006 Feb 28
3
Object#id will be deprecated?
I didn''t get the memo on this :P members_controller.rb:12: warning: Object#id will be deprecated; use Object#object_id Line 12 is: @member = Member.find(@current_member.id) How _should_ I be writing that line? Thanks, Joe -- Posted via http://www.ruby-forum.com/.
2005 Dec 27
3
myObject.send(column.name) from Agile Development book
I''m studying the Agile Development with Rails book. In the chapter that first sets up the depot application (page 68), there is this bit of code from a view: <% for product in @products %> <tr> <% for column in Product.content_columns %> <td><%=h product.send(column.name) %></td> <% end %> etc... I am trying to absorb both Ruby and
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in ActionView::Helpers::TagHelper to do some generalized error handling similar to the way scaffolding puts a red border around fields that fail validation. I''ve created a file lib/rails_patches/tag_helper.rb which contains the following. module ActionView module Helpers module TagHelper alias_method :orig_tag, :tag
2005 Mar 09
21
Converting time retrieved from MySQL
I''m having a problem converting a date retrieved from my MySQL database and I''m hoping someone can help. MySQL stores the date/time as this: 2005-03-08 17:00:34.0 and according to my Pickaxe book Ruby stores times as "the number of seconds and microseconds since [...] January 1, 1970". All well and good. Unfortunately, RoR is converting my date to this:
2009 Jul 21
1
[PATCH server] Fixed db-omatic so it doesn't segfault because of newer qmf api.
--- src/db-omatic/db_omatic.rb | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb index 155ff5e..b5b7b81 100755 --- a/src/db-omatic/db_omatic.rb +++ b/src/db-omatic/db_omatic.rb @@ -270,10 +270,10 @@ class DbOmatic < Qpid::Qmf::Console end def object_props(broker, obj) - target =
2005 Dec 28
1
FCGI: warning: Object#id will be deprecated; use Object#object_id?
I am seeing some strange entries in my Apache error log from FCGI that I don''t understand. I have pasted one of the lines below. Anyone seen this or know what might be going on? [Wed Dec 28 08:35:50 2005] [error] [client 24.115.131.100] FastCGI: server "/home/www/apps/appname/public/dispatch.fcgi" stderr: /home/www/apps/appname/app/views/photo/fullsize.rhtml:26: warning:
2006 Mar 20
2
Rails Plugin to Help Debug Views
Hi, I just released a plugin to help debug views. The plugin makes it easy to add a button that will popup a new window that displays the following debug data; * Request Parameters * Session Variables * Flash Variables * Assigned Template Variables It was derived from code that traces back to Marten Veldthuis in Epilog. You can check out webpage and plugin via;
2009 Oct 14
2
How to configure every (postgresql) db connection?
I would like to set some db session variables specific to my application on the database connection that rails uses. They can be set by issuing an SQL command like "SET statement_timeout = 1000" once - it will be in effect for every subsequent SQL statement that uses this connection. So I tried to put the following into an initializer: ActiveRecord::Base.connection.execute("SET
2011 Mar 15
8
Problems with Object#id deprecation
Hello everyone, in a test helper in my app I call category.id that gets the id of category in the database. However, when running RSpec I get the following error: As a parla customer /Users/saulolopes/code/parla/spec/acceptance/support/paths.rb:13: warning: Object#id will be deprecated; use Object#object_id /Users/saulolopes/code/parla/spec/acceptance/support/paths.rb:13: warning: Object#id
2006 Mar 04
13
Using helpers from controllers ?
There is a solution to use helpers from controllers ? I have an error : |undefined method `content_tag''| class ApplicationController < ActionController::Base def test return content_tag("a","test") end end
2006 Nov 20
1
undefined method `stringify_keys!' for "4":String - Meaning of this?
Hi, I have the following on a view <% for evaluation in @evaluations %> <td><%=h evaluation[0].name %></td> <td><%=evaluation[1].object_id %></td> <td><%= link_to( "Start", :action =>''evaluatie'', :id => evaluation[1].object_id) %></td> <%end%> When I click on the link, I can see that
2012 Nov 12
3
Updating objects in arrays
Perhaps this is a Rails issue. However, I need to first determine whether I simply am missing something about updating members of an array. I have an array of 10 ActiveRecord objects. I wish to iterate over the array and update an attribute. When I do this the underlying table row changes but the object in the array frequently does not. For example: count = 0 current_entries.each do
2006 Jan 19
2
Easy way to handle form input without a model class?
I have a couple forms that I''d like to be able to validate and automatically populate, but it shouldn''t be based on AR. In fact I often have a bunch of small forms that I can''t really justify writing a whole new model class for anyway. I''d like to validate the form input, and then use rails helpers to automatically populate the form if validations fail.