Displaying 2 results from an estimated 2 matches for "ognl".
Did you mean:
ogni
2006 May 24
3
Real life use of multiple linked models in the same view
...now, in order to fully learn RoR, I''m trying to replicate a project developed in Java using Hibernate+Tapestry. Tapestry is based on components and you can really use objects mappings in views like:
Example from the contact edit (view).
<input jwcid="@TextField" value="ognl:contact.name" />
<input jwcid="@TextField" value="ognl:contact.officePhone.value" />
The same RoR code should look like:
<%= text_field ''contact'', ''name'' %></p>
<%= text_field ''contact[office_phone]'...
2006 May 31
7
How do you create a controller & view to create a list of objects?
I''m trying to figure out how to design a view and controller to work with a
simple collection. I have a Foo that has many Bars, so here''s what I did:
$ ruby script/generate model Foo
$ ruby script/generate model Bar
(Uncomment t.column, :name: :string in foo and bar migrations)
(Edit Foo.rb and Bar.rb, add has_many :bars to Foo, belongs_to :foo to Bar)
$ rake db:migrate
$ ruby