I have two models:
Class Foo
field :title
end
Class Bar
field :description
end
In IRB I tried:
1.9.3p125 :001 > f = Foo.new(title: "<%= bar.description %>")
=> #<Foo _id: 506b2de61d41c84b07000002, _type: nil, title: "<%= bar.description %>">
1.9.3p125 :002 > f.save
=> true
1.9.3p125 :004 > f.title
=> "<%= bar.description %>"
How I put Object Bar inside f.title attribute?
Is it possible?
you don’t need the string interpolation, just set the title to bar.description
If you wanted to include extra stuff with it you can do this.
If you really wanted the erb handlers in there you could do