Still having some trouble getting basic form correct.
Here is first attempt at a form other than user, which now works fine.
<def tag="padconnectform" polymorphic />
<def tag="padconnectform" for="ArchitectAgentComment">
<div id="padcomment">
<% o=ArchitectAgentComment.new %>
<form merge param="default" with="&o"
update="architect_agent_comments"
success="Event.onReady(function()
{$('padcomment').style.visibility='hidden';$
('padconnect_confirm').style.visibility='visible';});">
<p>
<textarea name="architect_agent_comment[comment]"
id="architect_agent_comment[comment]" /><br />
<input name="architect_agent_comment[contact_You]"
id="architect_agent_comment[contact_You]"
for='boolean' param="pleasecontact" />
<textarea name="architect_agent_comment[interest]"
id="architect_agent_comment[interest]" />
</p>
</form>
</div>
<div param="actions">
<submit label="Save" param/>
<or-cancel param="cancel"/>
</div>
</def>
Thought with="&o" would give me the context of a new
ArchitectAgentComment.
In my model for architect_agent_comment.rb:
belongs_to :user
def creatable_by?
creator == user and not creator.guest?
end
def update_permitted?
acting_user.signed_up?
end
Controller:
auto_actions :all, :except => :index
And there must be a DRYML way to do this without repetition of name/id
info, but still be
able to give custom field names, or no field names?
Cheers,
jet
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---