journalduhacker/app/views/login/index.html.erb
joshua stein 9f5e04bbba use _path for most things instead of _url
Instead of hard-coding the scheme and host everywhere, use _path
methods to show relative URLs.

Except that our previous setting of
Rails.application.routes.default_url_options in
config.after_initialize made this moot because Rails inserts that
host into all _path helpers for some reason.  So revert that
setting.

But then anything that wants an absolute URL doesn't know the
hostname and the root_url helper throws an exception.  So make a
Rails.application.root_url shortcut to pass the per-app settings in
Rails.application to root_url.

Now we can just use _path helpers most places but still use _url
ones where we need them, such as in RSS views and e-mail templates.
2015-01-02 17:02:55 -06:00

42 lines
1,014 B
Plaintext

<div class="box wide">
<div class="legend">
Login
</div>
<%= form_tag login_path do %>
<p>
<%= label_tag :email, "E-mail or Username:" %>
<%= text_field_tag :email, "", :size => 30, :autofocus => "autofocus" %>
<br />
<%= label_tag :password, "Password:" %>
<%= password_field_tag :password, "", :size => 30 %>
<br />
</p>
<p>
<%= submit_tag "Login" %>
</p>
<p>
Forgot your password? <%= link_to "Reset your password",
forgot_password_path %>.
</p>
<p>
Not a user yet? Signup is by invitation only to combat spam and increase
accountability. If you know <a href="/u/">a current user</a> of the site,
ask them for an
<% if Rails.application.allow_invitation_requests? %>
invitation or <a href="/invitations/request">request one publicly</a>.
<% else %>
invitation.
<% end %>
</p>
<% if @referer.present? %>
<%= hidden_field_tag :referer, @referer %>
<% end %>
<% end %>
</div>