-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4657ba
commit 754525d
Showing
16 changed files
with
74 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
class UsersController < ApplicationController | ||
def new | ||
@user = User.new(job_experience: JobExperience.new) | ||
#@job_experience = JobExperience.new(:user_id => 1) #current_user.user_id) | ||
#@job_experience.save | ||
# @user = User.new(job_experience: JobExperience.new) | ||
# super | ||
# @user = User.new | ||
end | ||
|
||
def create | ||
@user = User.new(params[:user]) | ||
if @user.save | ||
redirect_to(@user, notice: "User was successfully created") | ||
else | ||
render :new | ||
end | ||
# super | ||
# @user = User.new(params[:user]) | ||
# if @user.save | ||
# redirect_to(@user, notice: "User was successfully created") | ||
#redirect_to(next page from ppt) | ||
# else | ||
# render :new | ||
# end | ||
|
||
# from tutorial | ||
# @user = User.new(params[:user]) | ||
# if @user.save | ||
# redirect_to @user | ||
# else | ||
# render :action => 'new' | ||
# end | ||
|
||
end | ||
|
||
# from tutorial | ||
# def update | ||
# super | ||
# @user = User.find(params[:id]) | ||
# if @user.update(params[:user]) | ||
# redirect_to @user | ||
# else | ||
# render :action => 'edit' | ||
# end | ||
# end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module FormHelper | ||
def setup_user(user) | ||
#user.job_experience ||= JobExperience.new | ||
2.times { user.job_experiences.build } | ||
user | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<%= simple_form_for(@user) do |f| %> | ||
|
||
<h2> Job Experiences </h2> | ||
<%= f.fields_for :job_experiences_attributes do |j| %> | ||
<div> | ||
<%= j.label :company %> | ||
<%= j.text_field :company %> | ||
</div> | ||
<% end %> | ||
|
||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ | |
</div> | ||
<% end %> | ||
|
||
<!-- <div class="form-inputs"> </div> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<%= simple_form_for(@user) do |f| %> | ||
|
||
<h2> Job Experiences </h2> | ||
<%= f.fields_for :job_experiences do |j| %> | ||
<div> | ||
<%= j.label :company %> | ||
<%= j.text_field :company %> | ||
</div> | ||
<% end %> | ||
|
||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters