hi all,
I'm trying to set up a simple form and getting some odd behavior in the
resulting action.
Following is my code for the form:
<% form_for @user_session do |f| %>
<%= render 'shared/error_messages', :object => f.object %>
<p>
<%= f.label :email %><br />
<%= f.text_field :email %>
</p>
<p>
<%= f.label :password %><br />
<%= f.password_field :password %>
</p>
<p><%= f.submit "Submit" %></p>
<% end %>
Following is the logic in the "new" action for the controller associated
with this view:
def new
@title = "Login"
@user_session = UserSession.new
end
I'm using Authlogic for my UserSession:
class UserSession < Authlogic::Session::Base
def to_key
new_record? ? nil : [ self.send(self.class.primary_key) ]
end
end
Following is the HTML output of the form:
<form accept-charset="UTF-8"
action="/user_sessions/%23%3CUserSession:0x103863f40%3E"
class="new_user_session" id="new_user_session" method="post">
Why isn't the action = to "/user_sessions" - where is that additional
bit coming from and how can I get rid of it?
Thanks,
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en.