Fernando wrote:
> I've got a Person model, with one of its attributes being of the Money
> value class:
>
> class Person < ActiveRecord::Base
>
> hobo_model # Don't put anything above this
>
> fields do
> field1 :string
> field2 :string
> credit_limit_amount :decimal, :precision => 10, :scale =>
> 3, :default => 0
> credit_limit_currency_id :integer
> field3 :string
> timestamps
> end
>
> composed_of :credit_limit, :class_name => 'Money', :mapping => [%w
> (credit_limit_amount amount), %w(credit_limit_currency_id
> currency_id)]
>
> end
>
> I've redefined the view tag for money like this:
>
> <def tag="view" for="Money">
> <%= this.currency.symbol + ' ' + this.amount.to_s %>
> </def>
>
> It shows perfectly on the Person show page.
>
> The problem is with the Person edit form. The field does not show, nor
> does its label.
> It doesn't matter if I include it explicitly in field-list, or I
> redefine the
> input tag.
I've never used composed_of. Didn't even know about it. Looks pretty cool.
Until I get a chance to fix this for you, you can use an HTML input tag
without the hobo smarts by providing the type attribute. For example:
<input type="text" name="#{param_name_for_this}[credit_limit]" />
>
> Also, the /persons/new page says "The page you were looking for could
> not be found"
> even though auto_actions is :all and I'm logged in as admin.
>
> Any clues as to why this is happening ?
In the quoted code snippet, did you delete your permission functions or
are they missing?
cheers,
Bryan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---