# Undefined method f\_title

**URL:** <https://www.ruby-forum.com/t/undefined-method-f-title/151823>\
**Category:** Rails\
**Created:** [October 26, 2008, 11:12am UTC](https://www.ruby-forum.com/t/undefined-method-f-title/151823 "2008-10-26T11:12:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Commander\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Post date:** [October 26, 2008, 11:12am UTC](https://www.ruby-forum.com/t/undefined-method-f-title/151823/1 "2008-10-26T11:12:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Commander\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Post date:** [October 26, 2008, 11:38am UTC](https://www.ruby-forum.com/t/undefined-method-f-title/151823/2 "2008-10-26T11:38:36Z")

</div>

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 J.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> t.string :name, :null => false
> 
> ```
> 
> 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/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)  
João Pessoa, PB, +55 83 8867-7208

---

<div class="post-metadata">

**Author:** ![Commander\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Post date:** [October 29, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/undefined-method-f-title/151823/3 "2008-10-29T19:16:26Z")

</div>

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 \<

---

<div class="post-metadata">

**Author:** ![Commander\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Commander\_J](https://www.ruby-forum.com/u/Commander_J)\
**Post date:** [October 29, 2008, 8:32pm UTC](https://www.ruby-forum.com/t/undefined-method-f-title/151823/4 "2008-10-29T20:32:49Z")

</div>

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 J. \<
