On Jan 3, 2011, at 4:56 PM, Donald R. Ziesig wrote:

> Happy New Year to all to whom it applies!!! :-) 
> 
> I am having problems overriding tags associated with the new action for an 
> object:
> 
> The pages.dryml contains the following:
> 
> <def tag="new-page" for="AgentDocument">
>   <page merge title="#{ht 'agent_document.new.title', :default=>[' New Agent 
> document'] }">
>     <body: class="new-page agent-document" param/>
> 
> *
> *
> *
>   </page>
> </def>
> 
> and
> 
> <def tag="new-for-profile-page" polymorphic/>
> <def tag="new-for-profile-page" for="AgentDocument">
>   <page merge title="#{ht 'agent_document.new_for_owner.title', 
> :default=>['New Agent document for']} #{name :with => @profile}">
>     <body: class="new-for-owner-page  agent-document" param/>
> *
> *
> *
>   </page>
> </def>
> 
> In pre23,  the new-page for AgentDocument could be overridden in the file 
> views/agent_documents/new.dryml, but in pre25, that no longer seems to work.  
> I also have no idea where to put the override code for the polymorphic tag.
> 
> I copied both of the tags into the new.dryml file, with no luck.  When I 
> added a deliberate error in the new.dryml file it was not detected, leading 
> me to believe that the file was never compiled.
> 

Which action are you using to try this out? From the generated pages, it looks 
like you've got:

auto_actions_for :profile, ...

in your controller, in which case the relevant view file will be 
app/views/agent_documents/new_for_profile.dryml rather than just new.dryml.


> I need this to let me use the HTML <input type="file" name="somename" 
> size="chars"> (is there a hobo tag for that?) so that the users can upload 
> documents and/or images.

Definitely check out the notes on using paperclip_with_hobo on the cookbook; 
pretty helpful. With that, I use the following (in 
app/views/taglibs/application.dryml or the equivalent subsite taglib):

<extend tag="form" for="Announcement">
  <old-form merge multipart>
    <field-list: fields="title, description, audio" />
  </old-form>
</extend>

<def tag="input" for="Paperclip::Attachment">
  <%= file_field_tag param_name_for_this, attributes %>
</def>

('audio' is the name passed to has_attached_file)

--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].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to