Show a devise log in form in another page

Update: there’s a new version of this post covering Devise 4.0.0: Show a devise log in or sign up forms in another page

Devise create various forms, among them one for signing up and one for logging in of course. These are the forms as they are generated in Devise 1.0.8:

<h2>Sign up</h2>
<% form_for resource_name, resource, :url => registration_path(resource_name) do |f| -%>
  <%= f.error_messages %><%= f.label :email %>

<%= f.text_field :email %>

<%= f.label :password %>

<%= f.password_field :password %>

<%= f.label :password_confirmation %>

<%= f.password_field :password_confirmation %>

<%= f.submit "Sign up" %>

<% end -%>

<%= render :partial => "shared/devise_links" %>


<h2>Sign in</h2>
<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%><%= f.label :email %>

<%= f.text_field :email %>

<%= f.label :password %>

<%= f.password_field :password %>

<% if devise_mapping.rememberable? -%><%= f.check_box :remember_me %> <%= f.label :remember_me %>

<% end -%><%= f.submit "Sign in" %>

<% end -%>

<%= render :partial => "shared/devise_links" %>

If you try to put them somewhere else you’ll run into some problem. There are some variables/methods those forms use that you’ll be lacking, specifically: resource_name, resource and for logging in also devise_mapping. I’ve recently tried to put them both in the homepage for an upcoming project of mine and this is how I’ve solved it:

module ContentHelper
  def resource_name

  def resource
    @resource ||=

  def devise_mapping
    @devise_mapping ||= Devise.mappings[:user]

Don't ignore the technology!

Technology is making the word more efficient. At some point, communicating with a person far away, required writing down the message with ink in a piece of dead tree and have someone or some company physically move that to the other location. Now we fire an email and it’ there in seconds.

I’m actually not sure if in that case we are more efficient (global communication infrastructure vs global transportation infrastructure and gas for the trucks and planes), we are definitely faster.

Recently my oven broke. The door is not stoping when it should and goes almost all the way to the floor when you open it. I’ve notified the management company and wanting to make the process more efficient I’ve recorded a video of the issue and sent it to them. Ah, technology, love it!

Today the repair main arrived (at 7:30hs, very Swiss). He open the door and… “Ah! It’s broken, I’ll come back next week with the spare parts.”

Honestly I wasn’t surprised, but we already have the technology to make this whole thing more efficient, I did my part and I was ignored. I bet the apartment management company never sent the guy the video.

Flying my Extra 300S

[flickr-gallery mode=”photoset” photoset=”72157624781646370″]

Overview of my new Extra 300S

Some pictures of the building process and the finished result:

[flickr-gallery mode=”photoset” photoset=”72157624560393349″]