-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jw invites #32
base: master
Are you sure you want to change the base?
Jw invites #32
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class InvitesController < ApplicationController | ||
def create | ||
email = params[:email] | ||
InviteMailer.invite_email(email).deliver | ||
redirect_to root_path | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace detected. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class InviteMailer < ActionMailer::Base | ||
default from: "[email protected]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
|
||
def invite_email(email) | ||
@email = email | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need to set |
||
@url = 'http://dundermifflin.com' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this used in the view? Should it be? |
||
mail(to: @email, subject: 'Welcome to the Dunder Mifflin Family!') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be worth passing in or somehow setting the company name so that you can easily change it later. |
||
end | ||
|
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
<li><a href="javascript:void(0)">About</a></li> | ||
<li><a href="javascript:void(0)">Contact</a></li> | ||
<li><a href="javascript:void(0)">Products</a></li> | ||
<li><%= link_to "Invite Users", invite_path %></li> | ||
</ul> | ||
|
||
<div class="footer-secondary-links"> | ||
|
@@ -15,3 +16,4 @@ | |
</ul> | ||
</div> | ||
</footer> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra line |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' /> | ||
</head> | ||
<body> | ||
<h1>Welcome to Dunder Mifflin!</h1> | ||
<p> | ||
Head over to DunderMifflin.com and create your account!</p> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="invite"> | ||
<%= form_for(:invite, url: invite_path, method: :post) do |form| %> | ||
<%= form.text_field :email, placeholder: "Enter Email Address" %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything inside |
||
<button type="submit"> | ||
<img src="/search-icon.png" alt=""> | ||
</button> | ||
<% end %> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,7 @@ | |
|
||
resource :job_title_users, only: ['create'] | ||
|
||
resource :invite, only: [:create] | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra line |
||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have 3 values for margin? I thought it was either two values (top/bottom left/right) or all four.
Also, instead of the comment, I'd extract an SCSS variable: