Skip to content

Instantly share code, notes, and snippets.

@libryder
Created August 14, 2012 16:47
Show Gist options
  • Select an option

  • Save libryder/3350784 to your computer and use it in GitHub Desktop.

Select an option

Save libryder/3350784 to your computer and use it in GitHub Desktop.
get '/' do
@title = "ThePostBin - Home"
if user_id = session[:user_id]
@user = User.find(user_id)
end
haml :index
end
%h2 Welcome.
-if session[:user_id]
Hello #{@user.name}
-else
%p
Please signup
%form{ :action => '/users/signup', :method => 'post' }
%fieldset
%div
%label{ :for => "name" } Name:
%input{ :type => "text", :name => "name" }
%div
%label{ :for => "email" } Email:
%input{ :type => "text", :name => "email" }
%div
%label{ :for => "password" } Password:
%input{ :type => "password", :name => "password" }
%input{:type => "submit", :value => "Signup", :class => "button"}
%html
%head
%title #{@title}
%body
-yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment