Permalink
Browse files

deposit 관련 내용 추가

  • Loading branch information...
1 parent 1e88174 commit 037a89bb483b30230b0e02bc9c1a2b29a3babecd @youngmin committed Nov 4, 2011
Showing with 288 additions and 254 deletions.
  1. +1 −0 app/controllers/action_customs_controller.rb
  2. +83 −0 app/controllers/deposit_thresholds_controller.rb
  3. +7 −0 app/controllers/deposits_controller.rb
  4. +3 −3 app/controllers/products_controller.rb
  5. +0 −83 app/controllers/sub_deposits_controller.rb
  6. +2 −0 app/helpers/deposit_thresholds_helper.rb
  7. +0 −2 app/helpers/sub_deposits_helper.rb
  8. +2 −0 app/models/deposit_threshold.rb
  9. +0 −5 app/models/sub_deposit.rb
  10. +5 −1 app/views/action_custom_factors/edit.html.erb
  11. +3 −1 app/views/action_custom_factors/index.html.erb
  12. +1 −1 app/views/action_custom_factors/new.html.erb
  13. +6 −1 app/views/action_custom_factors/show.html.erb
  14. +5 −1 app/views/action_customs/edit.html.erb
  15. +5 −1 app/views/action_customs/index.html.erb
  16. +5 −1 app/views/action_customs/new.html.erb
  17. +10 −1 app/views/action_customs/show.html.erb
  18. +24 −0 app/views/deposit_thresholds/edit.html.erb
  19. +24 −0 app/views/deposit_thresholds/index.html.erb
  20. +5 −5 app/views/{sub_deposits → deposit_thresholds}/new.html.erb
  21. +18 −0 app/views/deposit_thresholds/show.html.erb
  22. +1 −1 app/views/layouts/{sub_deposits.html.erb → deposit_thresholds.html.erb}
  23. +0 −28 app/views/sub_deposits/edit.html.erb
  24. +0 −26 app/views/sub_deposits/index.html.erb
  25. +0 −23 app/views/sub_deposits/show.html.erb
  26. +2 −2 config/routes.rb
  27. +0 −15 db/migrate/20111104011449_create_sub_deposits.rb
  28. +15 −0 db/migrate/20111104051052_create_deposit_thresholds.rb
  29. +9 −1 db/schema.rb
  30. +2 −2 test/fixtures/{sub_deposits.yml → deposit_thresholds.yml}
  31. +45 −0 test/functional/deposit_thresholds_controller_test.rb
  32. +0 −45 test/functional/sub_deposits_controller_test.rb
  33. +1 −1 test/unit/{sub_deposit_test.rb → deposit_threshold_test.rb}
  34. +4 −0 test/unit/helpers/deposit_thresholds_helper_test.rb
  35. +0 −4 test/unit/helpers/sub_deposits_helper_test.rb
@@ -8,6 +8,7 @@ def index
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @action_customs }
+ format.json { render :json => @action_customs }
end
end
@@ -0,0 +1,83 @@
+class DepositThresholdsController < ApplicationController
+ # GET /deposit_thresholds
+ # GET /deposit_thresholds.xml
+ def index
+ @deposit_thresholds = DepositThreshold.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @deposit_thresholds }
+ end
+ end
+
+ # GET /deposit_thresholds/1
+ # GET /deposit_thresholds/1.xml
+ def show
+ @deposit_threshold = DepositThreshold.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @deposit_threshold }
+ end
+ end
+
+ # GET /deposit_thresholds/new
+ # GET /deposit_thresholds/new.xml
+ def new
+ @deposit_threshold = DepositThreshold.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @deposit_threshold }
+ end
+ end
+
+ # GET /deposit_thresholds/1/edit
+ def edit
+ @deposit_threshold = DepositThreshold.find(params[:id])
+ end
+
+ # POST /deposit_thresholds
+ # POST /deposit_thresholds.xml
+ def create
+ @deposit_threshold = DepositThreshold.new(params[:deposit_threshold])
+
+ respond_to do |format|
+ if @deposit_threshold.save
+ format.html { redirect_to(@deposit_threshold, :notice => 'DepositThreshold was successfully created.') }
+ format.xml { render :xml => @deposit_threshold, :status => :created, :location => @deposit_threshold }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @deposit_threshold.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /deposit_thresholds/1
+ # PUT /deposit_thresholds/1.xml
+ def update
+ @deposit_threshold = DepositThreshold.find(params[:id])
+
+ respond_to do |format|
+ if @deposit_threshold.update_attributes(params[:deposit_threshold])
+ format.html { redirect_to(@deposit_threshold, :notice => 'DepositThreshold was successfully updated.') }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @deposit_threshold.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /deposit_thresholds/1
+ # DELETE /deposit_thresholds/1.xml
+ def destroy
+ @deposit_threshold = DepositThreshold.find(params[:id])
+ @deposit_threshold.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(deposit_thresholds_url) }
+ format.xml { head :ok }
+ end
+ end
+end
@@ -7,6 +7,7 @@ def index
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @deposits }
+ format.json { render :json => @deposits }
end
end
@@ -18,6 +19,7 @@ def show
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @deposit }
+ format.json { render :json => @deposit }
end
end
@@ -46,9 +48,11 @@ def create
if @deposit.save
format.html { redirect_to(@deposit, :notice => 'Deposit was successfully created.') }
format.xml { render :xml => @deposit, :status => :created, :location => @deposit }
+ format.json { render :json => @deposit, :status => :created, :location => @deposit }
else
format.html { render :action => "new" }
format.xml { render :xml => @deposit.errors, :status => :unprocessable_entity }
+ format.json { render :json => @deposit.errors, :status => :unprocessable_entity }
end
end
end
@@ -62,9 +66,11 @@ def update
if @deposit.update_attributes(params[:deposit])
format.html { redirect_to(@deposit, :notice => 'Deposit was successfully updated.') }
format.xml { head :ok }
+ format.json { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @deposit.errors, :status => :unprocessable_entity }
+ format.json { render :json => @deposit.errors, :status => :unprocessable_entity }
end
end
end
@@ -78,6 +84,7 @@ def destroy
respond_to do |format|
format.html { redirect_to(deposits_url) }
format.xml { head :ok }
+ format.json { head :ok }
end
end
end
@@ -165,11 +165,11 @@ def update
@prd_attribute = @product.prd_attribute
# send_to_cs(@product.prd_attribute, @product.prd_subscriptions, @product.prd_promotions, @product.prd_additional_services )
- f = open("http://localhost:3000/ccbs_products/"+@prd_attribute.id.to_s+'.json')
+ #f = open("http://localhost:3000/ccbs_products/"+@prd_attribute.id.to_s+'.json')
#debugger
- webpage = f.read
- f.close
+ #webpage = f.read
+ #f.close
#make_rules(product_id, @product.prd_attribute.name)
end
@@ -1,83 +0,0 @@
-class SubDepositsController < ApplicationController
- # GET /sub_deposits
- # GET /sub_deposits.xml
- def index
- @sub_deposits = SubDeposit.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @sub_deposits }
- end
- end
-
- # GET /sub_deposits/1
- # GET /sub_deposits/1.xml
- def show
- @sub_deposit = SubDeposit.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @sub_deposit }
- end
- end
-
- # GET /sub_deposits/new
- # GET /sub_deposits/new.xml
- def new
- @sub_deposit = SubDeposit.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @sub_deposit }
- end
- end
-
- # GET /sub_deposits/1/edit
- def edit
- @sub_deposit = SubDeposit.find(params[:id])
- end
-
- # POST /sub_deposits
- # POST /sub_deposits.xml
- def create
- @sub_deposit = SubDeposit.new(params[:sub_deposit])
-
- respond_to do |format|
- if @sub_deposit.save
- format.html { redirect_to(@sub_deposit, :notice => 'SubDeposit was successfully created.') }
- format.xml { render :xml => @sub_deposit, :status => :created, :location => @sub_deposit }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @sub_deposit.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /sub_deposits/1
- # PUT /sub_deposits/1.xml
- def update
- @sub_deposit = SubDeposit.find(params[:id])
-
- respond_to do |format|
- if @sub_deposit.update_attributes(params[:sub_deposit])
- format.html { redirect_to(@sub_deposit, :notice => 'SubDeposit was successfully updated.') }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @sub_deposit.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /sub_deposits/1
- # DELETE /sub_deposits/1.xml
- def destroy
- @sub_deposit = SubDeposit.find(params[:id])
- @sub_deposit.destroy
-
- respond_to do |format|
- format.html { redirect_to(sub_deposits_url) }
- format.xml { head :ok }
- end
- end
-end
@@ -0,0 +1,2 @@
+module DepositThresholdsHelper
+end
@@ -1,2 +0,0 @@
-module SubDepositsHelper
-end
@@ -0,0 +1,2 @@
+class DepositThreshold < ActiveRecord::Base
+end
@@ -1,5 +0,0 @@
-class SubDeposit < ActiveRecord::Base
- belongs_to :deposit,
- :class_name => 'Deposit',
- :foreign_key => 'deposit_id'
-end
@@ -4,6 +4,10 @@
<%= f.error_messages %>
<p>
+ <%= f.label :id %><br />
+ <%= f.text_field :id %>
+ </p>
+ <p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
@@ -25,4 +29,4 @@
<% end %>
<%= link_to 'Show', @action_custom_factor %> |
-<%= link_to 'Back', action_custom_factors_path %>
+<%= link_to 'Back', action_custom_factors_path %>
@@ -2,6 +2,7 @@
<table>
<tr>
+ <th>Id</th>
<th>Name</th>
<th>Value</th>
<th>Operation</th>
@@ -10,6 +11,7 @@
<% @action_custom_factors.each do |action_custom_factor| %>
<tr>
+ <td><%=h action_custom_factor.id %></td>
<td><%=h action_custom_factor.name %></td>
<td><%=h action_custom_factor.value %></td>
<td><%=h action_custom_factor.operation %></td>
@@ -23,4 +25,4 @@
<br />
-<%= link_to 'New action_custom_factor', new_action_custom_factor_path %>
+<%= link_to 'New action_custom_factor', new_action_custom_factor_path %>
@@ -24,4 +24,4 @@
</p>
<% end %>
-<%= link_to 'Back', action_custom_factors_path %>
+<%= link_to 'Back', action_custom_factors_path %>
@@ -1,4 +1,9 @@
<p>
+ <b>Id:</b>
+ <%=h @action_custom_factor.id %>
+</p>
+
+<p>
<b>Name:</b>
<%=h @action_custom_factor.name %>
</p>
@@ -20,4 +25,4 @@
<%= link_to 'Edit', edit_action_custom_factor_path(@action_custom_factor) %> |
-<%= link_to 'Back', action_custom_factors_path %>
+<%= link_to 'Back', action_custom_factors_path %>
@@ -12,9 +12,13 @@
<%= f.text_field :subfctr_code %>
</p>
<p>
+ <%= f.label :description %><br />
+ <%= f.text_field :description %>
+ </p>
+ <p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @action_custom %> |
-<%= link_to 'Back', action_customs_path %>
+<%= link_to 'Back', action_customs_path %>
@@ -2,14 +2,18 @@
<table>
<tr>
+ <th>Id</th>
<th>Subfctr name</th>
<th>Subfctr code</th>
+ <th>Description</th>
</tr>
<% @action_customs.each do |action_custom| %>
<tr>
+ <td><%=h action_custom.id %></td>
<td><%=h action_custom.subfctr_name %></td>
<td><%=h action_custom.subfctr_code %></td>
+ <td><%=h action_custom.description %></td>
<td><%= link_to 'Show', action_custom %></td>
<td><%= link_to 'Edit', edit_action_custom_path(action_custom) %></td>
<td><%= link_to 'Destroy', action_custom, :confirm => 'Are you sure?', :method => :delete %></td>
@@ -19,4 +23,4 @@
<br />
-<%= link_to 'New action_custom', new_action_custom_path %>
+<%= link_to 'New action_custom', new_action_custom_path %>
@@ -12,8 +12,12 @@
<%= f.text_field :subfctr_code %>
</p>
<p>
+ <%= f.label :description %><br />
+ <%= f.text_field :description %>
+ </p>
+ <p>
<%= f.submit 'Create' %>
</p>
<% end %>
-<%= link_to 'Back', action_customs_path %>
+<%= link_to 'Back', action_customs_path %>
@@ -1,4 +1,9 @@
<p>
+ <b>Id :</b>
+ <%=h @action_custom.id %>
+</p>
+
+<p>
<b>Subfctr name:</b>
<%=h @action_custom.subfctr_name %>
</p>
@@ -8,6 +13,10 @@
<%=h @action_custom.subfctr_code %>
</p>
+<p>
+ <b>Description:</b>
+ <%=h @action_custom.description %>
+</p>
<%= link_to 'Edit', edit_action_custom_path(@action_custom) %> |
-<%= link_to 'Back', action_customs_path %>
+<%= link_to 'Back', action_customs_path %>
Oops, something went wrong.

0 comments on commit 037a89b

Please sign in to comment.