Hi,
This is my migration:
class CreateSampleForms < ActiveRecord::Migration
def self.add_data
SampleForm.create(:name => ''Default (Empty)'', :f_type
=> ''Default
(Empty)'', :description => ''Use this template to create a
blank form.'')
end
def self.up
create_table :sample_forms do |t|
t.string :name, :null => false
t.string :f_title
t.text :description
t.timestamps
end
self.add_data
end
def self.down
drop_table :sample_forms
end
end
While migrating, it gives the error ''undefined method
f_title=''. I first
thought ''title'' was reserved so I renamed it to
''f_title''. When I remove it,
the process starts over with the description attribute.
CmdJohnson
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Try this:
class CreateSampleForms < ActiveRecord::Migration
def self.add_data
SampleForm.create(:name => ''Default (Empty)'', :f_type
=> ''Default
(Empty)'', :description => ''Use this template to create a
blank form.'')
end
def self.up
create_table :sample_forms do |t|
t.string :name, :null => false
t.string :f_title
t.text :description
t.timestamps
end
SampleForm.reset_column_information
self.add_data
end
def self.down
drop_table :sample_forms
end
end
On Sun, Oct 26, 2008 at 7:11 AM, Commander Johnson
<commanderjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
> This is my migration:
> class CreateSampleForms < ActiveRecord::Migration
> def self.add_data
> SampleForm.create(:name => ''Default (Empty)'',
:f_type => ''Default
> (Empty)'', :description => ''Use this template to create
a blank form.'')
> end
>
> def self.up
> create_table :sample_forms do |t|
> t.string :name, :null => false
> t.string :f_title
> t.text :description
> t.timestamps
> end
>
> self.add_data
> end
> def self.down
> drop_table :sample_forms
> end
> end
> While migrating, it gives the error ''undefined method
f_title=''. I first
> thought ''title'' was reserved so I renamed it to
''f_title''. When I remove it,
> the process starts over with the description attribute.
> CmdJohnson
> >
>
--
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
João Pessoa, PB, +55 83 8867-7208
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
To no avail: == 20081023195916 CreateSampleForms: migrating ===============================-- create_table(:sample_forms) -> 0.0610s rake aborted! undefined method `f_type='' for #<SampleForm:0x16856e3> rake aborted! On Sun, Oct 26, 2008 at 11:37 AM, Maurício Linhares < mauricio.linhares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Try this: > > class CreateSampleForms < ActiveRecord::Migration > def self.add_data > SampleForm.create(:name => ''Default (Empty)'', :f_type => ''Default > (Empty)'', :description => ''Use this template to create a blank form.'') > end > > def self.up > create_table :sample_forms do |t| > t.string :name, :null => false > t.string :f_title > t.text :description > > t.timestamps > end > SampleForm.reset_column_information > self.add_data > end > > def self.down > drop_table :sample_forms > end > end > > On Sun, Oct 26, 2008 at 7:11 AM, Commander Johnson > <commanderjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi, > > This is my migration: > > class CreateSampleForms < ActiveRecord::Migration > > def self.add_data > > SampleForm.create(:name => ''Default (Empty)'', :f_type => ''Default > > (Empty)'', :description => ''Use this template to create a blank form.'') > > end > > > > def self.up > > create_table :sample_forms do |t| > > t.string :name, :null => false > > t.string :f_title > > t.text :description > > t.timestamps > > end > > > > self.add_data > > end > > def self.down > > drop_table :sample_forms > > end > > end > > While migrating, it gives the error ''undefined method f_title=''. I first > > thought ''title'' was reserved so I renamed it to ''f_title''. When I remove > it, > > the process starts over with the description attribute. > > CmdJohnson > > > > > > > > > -- > Maurício Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) > João Pessoa, PB, +55 83 8867-7208 > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Rails doesn''t like the model name SampleForm. I created a scaffold called Tent with the same attributes which does work. CmdJohnson On Wed, Oct 29, 2008 at 7:15 PM, Commander Johnson < commanderjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> To no avail: > > == 20081023195916 CreateSampleForms: migrating > ===============================> -- create_table(:sample_forms) > -> 0.0610s > rake aborted! > undefined method `f_type='' for #<SampleForm:0x16856e3> > rake aborted! > > On Sun, Oct 26, 2008 at 11:37 AM, Maurício Linhares < > mauricio.linhares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> Try this: >> >> class CreateSampleForms < ActiveRecord::Migration >> def self.add_data >> SampleForm.create(:name => ''Default (Empty)'', :f_type => ''Default >> (Empty)'', :description => ''Use this template to create a blank form.'') >> end >> >> def self.up >> create_table :sample_forms do |t| >> t.string :name, :null => false >> t.string :f_title >> t.text :description >> >> t.timestamps >> end >> SampleForm.reset_column_information >> self.add_data >> end >> >> def self.down >> drop_table :sample_forms >> end >> end >> >> On Sun, Oct 26, 2008 at 7:11 AM, Commander Johnson >> <commanderjohnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hi, >> > This is my migration: >> > class CreateSampleForms < ActiveRecord::Migration >> > def self.add_data >> > SampleForm.create(:name => ''Default (Empty)'', :f_type => ''Default >> > (Empty)'', :description => ''Use this template to create a blank form.'') >> > end >> > >> > def self.up >> > create_table :sample_forms do |t| >> > t.string :name, :null => false >> > t.string :f_title >> > t.text :description >> > t.timestamps >> > end >> > >> > self.add_data >> > end >> > def self.down >> > drop_table :sample_forms >> > end >> > end >> > While migrating, it gives the error ''undefined method f_title=''. I first >> > thought ''title'' was reserved so I renamed it to ''f_title''. When I remove >> it, >> > the process starts over with the description attribute. >> > CmdJohnson >> > > >> > >> >> >> >> -- >> Maurício Linhares >> http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/(en) >> João Pessoa, PB, +55 83 8867-7208 >> >> >> >> >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- dom id on form_remote_tag
- ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Pleas
- Multiple tenants on Rails
- edit existing PDF as template
- Re: ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. P