Skip to content

Commit

Permalink
add styling and some unbreaking
Browse files Browse the repository at this point in the history
  • Loading branch information
cstavitsky committed Sep 13, 2015
1 parent 6f1806a commit 9a29074
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def create
redirect_to '/'
else
# If user's login doesn't work, send them back to the login form.
redirect_to '/login'
@error = "Login unsuccessful. Please try again or sign up if you do not have an account."
render 'new'
end
end

Expand Down
16 changes: 9 additions & 7 deletions app/views/coworkers/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<%= form_for @coworker, url: {action: "create"} do |f| %>
<p>First name (or however else you'd like them to be addressed in the email): <%= f.text_field :first_name %></p>
<p>Boss's email address: <%= f.text_field :email %></p>
<p>
<%= f.submit "Save Boss Information" %>
</p>
<% end %>
<div class="form-container">
<%= form_for @coworker, url: {action: "create"} do |f| %>
<p>First name (or however else you'd like them <br>to be addressed in the email): <%= f.text_field :first_name %></p>
<p>Boss's email address: <%= f.text_field :email %></p>
<p>
<%= f.submit "Save Boss Information" %>
</p>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/emails/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
</div>
<% else %>

<%= link_to "Click to start by adding your boss's email", new_coworker_path %>
<div class="form-container"><h1><%= link_to "Click to start by adding your boss's email", new_coworker_path %></h1></div>

<% end %>
3 changes: 3 additions & 0 deletions app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<h1>Login</h1>

<%if @error %>
<h2><%=@error%></h2>
<%end%>
<%= form_tag '/login' do %>

Email: <%= text_field_tag :email %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<%= form_for :user, url: '/users' do |f| %>

Name: <%= f.text_field :name %>
Email: <%= f.text_field :email %>
Password: <%= f.password_field :password %>
Password Confirmation: <%= f.password_field :password_confirmation %>
Name: <%= f.text_field :name %><br>
Email: <%= f.text_field :email %><br>
Password: <%= f.password_field :password %><br>
Password Confirmation: <%= f.password_field :password_confirmation %><br>
<%= f.submit "Submit" %>

<% end %>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
resources :coworkers

get '/login' => 'sessions#new'
post '/login' => 'sessions#create'
get '/logout' => 'sessions#destroy'
get '/signup' => 'users#new'
post '/users' => 'users#create'
Expand Down

0 comments on commit 9a29074

Please sign in to comment.