Okay, sorry to slam the list, but I was wondering if yall could give me some
input on my solution. I managed to get the timeline.duration field to
render on the form, but it was failing to save because it came back in
params as a HashWithIndifferentAccess. To get around this, I extended the
update method as so:
def update
timeline_hash = params['manuscript']['timeline']
find_instance.timeline = Timeline.create(:duration =>
timeline_hash['duration'])
params['manuscript'].delete('timeline')
hobo_update
end
I feel like this is a horrible hack, but maybe I'm expecting too much from
rails/hobo?
Thanks.
On Thu, Apr 29, 2010 at 2:37 PM, Chris Apolzon <[email protected]> wrote:
> Is this doable in DRYML? Or should I drop down to erb? I tried updating
> the form's <field-list> tag to include timeline.duration, but I get a
> mission method editable_by? on nil:NilClass.
>
>
> On Thu, Apr 29, 2010 at 12:27 PM, Matt Jones <[email protected]> wrote:
>
>>
>> On Apr 29, 2010, at 11:14 AM, Chris Apolzon wrote:
>>
>> I have a model (Manuscript) that has a has_one relationship to a model
>>> (Timeline). I would like to display the Timeline on the view page for
>>> the Manuscript, but if I add children :timeline to the Mansuscript
>>> ViewHints file, I get a missing method 'empty?' for HasOne
>>> association.
>>>
>>> I understand the has_one relationship is still being worked on in
>>> Hobo. Is there a simple way to get around this? Or should I scrap
>>> the viewhint and write my own card for this model?
>>>
>>
>> This is a case where the generated code (from the children viewhint) isn't
>> likely to be of much use. Even if it wasn't bombing out, what you'd get (a
>> single <card> tag) is probably missing most of what you'd want to show about
>> the timeline. You're better off handling this explicitly in your view.
>>
>> --Matt Jones
>>
>>
>> --
>> 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]<hobousers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/hobousers?hl=en.
>>
>>
>
--
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.