Show a devise log in form 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 %>
  <p><%= f.label :email %></p>
  <p><%= f.text_field :email %></p>
 
  <p><%= f.label :password %></p>
  <p><%= f.password_field :password %></p>
 
  <p><%= f.label :password_confirmation %></p>
  <p><%= f.password_field :password_confirmation %></p>
 
  <p><%= f.submit "Sign up" %></p>
<% end -%>
 
<%= render :partial => "shared/devise_links" %>

and

<h2>Sign in</h2>
 
<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%>
  <p><%= f.label :email %></p>
  <p><%= f.text_field :email %></p>
 
  <p><%= f.label :password %></p>
  <p><%= f.password_field :password %></p>
 
  <% if devise_mapping.rememberable? -%>
    <p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
  <% end -%>
 
  <p><%= f.submit "Sign in" %></p>
<% 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
    :user
  end
 
  def resource
    @resource ||= User.new
  end
 
  def devise_mapping
    @devise_mapping ||= Devise.mappings[:user]
  end
end
Posted in tutorial | Tagged , , | Leave a comment

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.

Posted in rant | Tagged | 1 Comment

Flying my Extra 300S

Posted in other | Tagged , , , , , , | Leave a comment

Overview of my new Extra 300S

Some pictures of the building process and the finished result:

Posted in announcement | Tagged , , , , , , | 3 Comments

It moves!

I’m building a RCPowers Extra 300S and a couple of days ago it moved by itself for the first time:

So exciting! There’s still a lot of work to do, I hope it’ll be flying this weekend (if the weather allows it).

Posted in other | Tagged , , , , , | Leave a comment

RadioControlPedia

I’m tired that there are no canonical URLs for most products, materials, systems, etc. regarding to radio control. The vendors do a very poor job of having an online presence. Some seem not to have a web site at all and the ones that do have very poor URLs, very poor data (old articles get removed) or very poor websites (frames, javascript, no way to deep-link).

Sometimes the best information is provided by the retailers, which is already wrong, but the real issue is that when retailers are not selling something anymore, they remove the product from the public page, and the information gets lost.

I’ve decided to fix the problem so I’ve created the RadioControlPedia. A wiki for RadioControl were articles will always stay and stay at the same URL. Over time it’ll have more and more information.

Posted in announcement | Tagged , , , | Leave a comment

.gitignore

I’m launching a new site:

gitignore.com

For now it’s just a blog, but the final goal is different:

Every time I start a new project I hesitate to make the first commit: what should I commit and what shouldn’t I? Essentially, what should I put on .gitignore.

The goal of this site is to collet snippet of .gitignore that one should use depending on what framework, software, libraries, etc. are being used. I’ll try to put the ones I’ll know, but please, if you know any, send me an email to pupeno@pupeno.com and I’ll publish (with attribution).

My final goal is to develop a small web application with a list of the frameworks (as checkboxes or something) from which you can pick and it’ll build the .gitignore. But I’ll only do it if this site gathers enough information.

Posted in announcement | Tagged , | Leave a comment

My first contribution to Rails

Looking forward to many others.

Posted in announcement | Tagged , | Leave a comment

Thanks for your contribution to the NetBeans 6.9

When I write software, bug reports and feature requests are a blessing. It shows me that people is using it and want more. Silence is death. It’s nice to see an software project show appreciation for bug reports and I’m honestly impressed:

Dear NetBeans User,

In the past you have taken the time to report issues that you encountered while using NetBeans software. A new version (NetBeans 6.9) has just been released,and we’d like to inform you that the following issue(s) you reported have been addressed in the new release:

181509 Dot paths not available when adding new platform in Ruby Platform Manager
181766 Gem directories picked wrongly
181844 Search for RVM installations

Please visit the netbeans.org website to download NetBeans 6.9 and to learn more about the new release.

We appreciate your contribution to our efforts to make NetBeans software and features better for all users. And as always, we look forward to feedback from you about ways we can continue to improve.Thank you.

The NetBeans Team

Posted in other | Tagged | Leave a comment

If I were in charge of Adobe

Clearly, Adobe is losing the battle with Apple. There’s no Flash on the iPhone, iPod Touch and iPad and there’s no sign that there will ever be.

Apple is not a company that can be easily influenced. They do things the way they think is right even when everybody else disagrees. Even when everybody predicts is going to cost sales. They’ve been doing it for more than 10 years and it’s working very well for them, they are not going to stop now. For Adobe, Apple is a lost cause.

I actually dislike both companies. Apple is building an extremely proprietary environment. They are much worst than Microsoft. Apple’s tax not only includes the operating system, it also includes every third party application. Not only they get a part of everybody’s cake, they decide who have cake and who doesn’t by controlling which applications get approval and which get rejected. If Apple ever dominates the industry, it’ll be the dark ages of computers.

Adobe is not much different with Flash. Flash is a proprietary and it works well on one and only one platform; if it does at all. Everybody else is left out. Flash has been making the web inaccessible for ages. I would be very glad if we can get rid of Flash.

If I were in charge of Adobe I would do something that would help the company remain a leader on the web and at the same time make Flash good: open source it.

I never understood why Adobe hasn’t open sourced Flash already. The specs are more or less open, there are alternative implementations, and they are not making any money by selling Flash. They make money by selling the tools to build Flash web sites and that’s not going to stop if they make Flash itself open source.

Before or while open sourcing I would make agreements with two companies: Google and HP. Make sure Flash is going to be included in Android, Chrome OS and Web OS. I would also put those phones and tablets in the hand of my developers (that is, Adobe’s), for free, as a gift, with the goal of making the Flash experience is absolutely thrilling.

I think that is Flash’s only hope.

Posted in idea | Tagged , , , , | Leave a comment