Hi François,
Never tried this. But this is what I would try first.
I would use a new action on the same controller. For that I would need
to add a route to the controller and then call hobo_create. For example:
def my_new_create
hobo_create do
....
end
end
Then I would create the view. That would be done with DRYML, by adding a
new file my_new_create.dryml with the tag:
<new-page>
<form ...>
<field-list:>
<field-list .... />
</field-list:>
</form>
</new-page>
Hope it helps.
TF
On 01/12/2011 01:47 AM, François Beausoleil wrote:
Any ideas on how I should implement this?
I need a specialized form for an existing model. There's a general
form which I use for general cases, and I need a 2nd form for when a
specific condition occurs. I thought of using a separate controller&
view, but Hobo doesn't seem to like that.
I suspect I'll switch to using<field-list if="&@show_bio" fields="a,
b, c"/> and the reverse condition.
Is there a better / easier / cleaner way?
Thanks,
François
On 9 jan, 21:09, François Beausoleil<[email protected]>
wrote:
Hi!
I've found this discussion, titled "Surprising route behavior":
http://groups.google.com/group/hobousers/browse_thread/thread/acab253...
This is exactly what I'm looking for, but routing is even more broken
in my case.
I have events and biographical notes. Notes are just a specialized
form for entering events. Here's my BiographicalNotesController:
class BiographicalNotesController< ApplicationController
hobo_model_controller Event
auto_actions_for :addressee, [:new, :create]
end
Running rake routes brings me back these routes:
new_event_for_addressee GET /addressees/:addressee_id/
events/new(.:format)
{:controller=>"events", :action=>"new_for_addressee"}
create_event_for_addressee POST /addressees/:addressee_id/
events(.:format)
{:controller=>"events", :action=>"create_for_addressee"}
Look at the controller -- completely broken. I understand Hobo is
model-centric, but instantiating actions in controller A and routing
to controller B is completely unexpected.
Anyway, my end goal is to have a specialized form just for
biographical notes. Events have a TEXT column, named notes, for
entering general notes. When someone creates a biographical note, it's
an event where a different set of fields (title, notes, source, date)
is re-formatted in the general notes field. I'm doing that because
later in the application I show all events pertaining to a person, and
biographical notes are just one type of event that pertains to people.
Any ideas on how I should implement this?
Thanks!
François
--
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.