I am getting an error, or rather capturing one
when I try to load a form.
I have required that a user must be logged in to create a comment in
<padconnectform> , by setting the creatable_by in the model:
def create_permitted?
return false unless owner_is? acting_user
state == "new"
end
I log in,
which appears to work fine, but after I try to load
<padconnectform> and it does not get loaded.
Is that the correct action if a user is not logged in? A form
will not load if the permissions are not correct?
Anyway, I wrapped the form with a test, and that gave me a message
that I was not logged in. Do I need to create a context of the user
before testing for logged in?
Here is the call and form:
<% o=ArchitectAgentComment.new(params[:architect_agent_comment]) %>
<padconnectform with="&o" />
...and the def:
<def tag="padconnectform">
<if test="&logged_in?"><p>POST A COMMENT</p>
<form with="&o" merge param="default" >
<error-messages param/>
<textarea:comment param="ideas" /><br />
<input:contact_You for='boolean'
param="pleasecontact" /><br />
<textarea:contact_About param="about" />
<div param="actions">
<submit label="Save" param/>
<or-cancel param="cancel"/>
</div>
</form>
</if>
<else><p>YOU MUST BE LOGGED IN TO POST A COMMENT</p></else>
</div>
</def>
The result of this is:
YOU MUST BE LOGGED IN TO POST A COMMENT
So I could assume that since I had logged in and no error was
generated, that
I need to have the context of current user for '&logged_in', or does
'&logged_in' do
that for me and I really am not logged in, even though 'success' was
successful? Or
could my login actually be failing even though I test for success I
get a positive result?
When I had a 'success' test in the login, it did return successful.
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
-~----------~----~----~----~------~----~------~--~---