Skip to content
Browse files

removed views added user email form

  • Loading branch information...
1 parent ce8fa80 commit c8cd23c4d3dfad67286b78836bbc2ec4cc113526 @leemartin leemartin committed Aug 31, 2010
View
4 app/views/posts/new.html.haml
@@ -28,4 +28,6 @@
- if SETTINGS["email"]
- %p or #{link_to "Submit Your Email", "#"}
+ %p or #{link_to "Submit Your Email", "#"}
+
+ = render "users/form"
View
12 app/views/users/_form.html.haml
@@ -0,0 +1,12 @@
+%div#user{:style => "display:none"}
+
+ - form_for User.new do |f|
+
+ = f.hidden_field :service, :value => "email"
+
+ %h2 Sign-up for Download
+
+ %p= f.text_field :email, :value => 'Enter Email Address', :onfocus => '(this.value == "Enter Email Address") ? this.value = "" : this.value'
+
+ %div.fr= f.submit "Submit", :class => "button update"
+ %div.clear
View
32 app/views/users/edit.html.erb
@@ -1,32 +0,0 @@
-<h1>Editing user</h1>
-
-<% form_for(@user) do |f| %>
- <%= f.error_messages %>
-
- <p>
- <%= f.label :service %><br />
- <%= f.text_field :service %>
- </p>
- <p>
- <%= f.label :user_id %><br />
- <%= f.text_field :user_id %>
- </p>
- <p>
- <%= f.label :name %><br />
- <%= f.text_field :name %>
- </p>
- <p>
- <%= f.label :email %><br />
- <%= f.text_field :email %>
- </p>
- <p>
- <%= f.label :location %><br />
- <%= f.text_field :location %>
- </p>
- <p>
- <%= f.submit 'Update' %>
- </p>
-<% end %>
-
-<%= link_to 'Show', @user %> |
-<%= link_to 'Back', users_path %>
View
31 app/views/users/new.html.erb
@@ -1,31 +0,0 @@
-<h1>New user</h1>
-
-<% form_for(@user) do |f| %>
- <%= f.error_messages %>
-
- <p>
- <%= f.label :service %><br />
- <%= f.text_field :service %>
- </p>
- <p>
- <%= f.label :user_id %><br />
- <%= f.text_field :user_id %>
- </p>
- <p>
- <%= f.label :name %><br />
- <%= f.text_field :name %>
- </p>
- <p>
- <%= f.label :email %><br />
- <%= f.text_field :email %>
- </p>
- <p>
- <%= f.label :location %><br />
- <%= f.text_field :location %>
- </p>
- <p>
- <%= f.submit 'Create' %>
- </p>
-<% end %>
-
-<%= link_to 'Back', users_path %>
View
28 app/views/users/show.html.erb
@@ -1,28 +0,0 @@
-<p>
- <b>Service:</b>
- <%=h @user.service %>
-</p>
-
-<p>
- <b>User:</b>
- <%=h @user.user_id %>
-</p>
-
-<p>
- <b>Name:</b>
- <%=h @user.name %>
-</p>
-
-<p>
- <b>Email:</b>
- <%=h @user.email %>
-</p>
-
-<p>
- <b>Location:</b>
- <%=h @user.location %>
-</p>
-
-
-<%= link_to 'Edit', edit_user_path(@user) %> |
-<%= link_to 'Back', users_path %>
View
12 db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20100725195715) do
+ActiveRecord::Schema.define(:version => 20100831200227) do
create_table "settings", :force => true do |t|
t.string "var", :null => false
@@ -20,4 +20,14 @@
add_index "settings", ["var"], :name => "index_settings_on_var"
+ create_table "users", :force => true do |t|
+ t.string "service"
+ t.string "user_id"
+ t.string "name"
+ t.string "email"
+ t.string "location"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
end

0 comments on commit c8cd23c

Please sign in to comment.
Something went wrong with that request. Please try again.