-
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
Nikola Trandafilovic
committed
Nov 22, 2011
1 parent
900b39c
commit 4113383
Showing
10 changed files
with
142 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class CountyLedgersController < ApplicationController | ||
def new | ||
@county_ledger = CountyLedger.new | ||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @county_ledger } | ||
end | ||
end | ||
|
||
def create | ||
@county_ledger = CountyLedger.new(params[:county_ledger]) | ||
respond_to do |format| | ||
|
||
if @county_ledger.save! | ||
format.html { redirect_to(ledger_path(@county_ledger.ledger)) } | ||
format.xml { render :xml => @county_ledger} #, :status => :created, :location => @journal } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @county_ledger.errors, :status => :unprocessable_entity } | ||
end | ||
|
||
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
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,2 @@ | ||
module CountyLedgerHelper | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<table> | ||
<tr> | ||
<th>t(:county, :scope => :counties</th> | ||
<th>t(:from, :scope => :counties</th> | ||
<th></th> | ||
</tr> | ||
<% if !@ledger.county_ledgers.blank? %> | ||
|
||
<% @ledger.county_ledgers.order('"from" asc').each do |cl| %> | ||
<tr> | ||
|
||
<td> <%= cl.county.name %></td> | ||
<td><%= cl.from %></td> | ||
<td> </td><%= %> | ||
<!-- | ||
link_to t(:destroy, :scope => :global), county_ledger_path, :confirm => 'Are you sure?', :method => :delete %></td> | ||
--> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
<tr> | ||
<%= form_for ([CountyLedger.new]) do |county_ledger| %> | ||
<%= county_ledger.hidden_field :ledger_id, :value => @ledger.id %> | ||
<td> | ||
<%= county_ledger.select :county_id, County.all.collect {|p| [p.name, p.id]} %> | ||
</td> | ||
<td> | ||
<%= county_ledger.text_field :from, :class=> :datepicker %> | ||
</td> | ||
<td> | ||
<%= submit_tag t(:add_county, :scope => :conties ) %> | ||
</td> | ||
|
||
<% end %> | ||
</tr> | ||
</table> |
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,36 @@ | ||
<h1><%= t(:showing_ledger, :scope => :ledgers) %> <%= @ledger %></h1> | ||
|
||
<p> | ||
<%= @ledger.number %> | ||
</p> | ||
<p> | ||
<%= @ledger.name %> | ||
</p> | ||
<p> | ||
<%= @ledger.account %> | ||
</p> | ||
<p> | ||
<%= @ledger.email %> | ||
</p> | ||
<p> | ||
<%= @ledger.address.street1 %> | ||
</p> | ||
<p> | ||
<%= @ledger.mobile_number %> | ||
</p> | ||
<p> | ||
<%= @ledger.customer_number %> | ||
</p> | ||
<p> | ||
<%= @ledger.ledger_bank_number %> | ||
</p> | ||
<p> | ||
</p> | ||
|
||
<p> | ||
<%= render :partial => "ledgers/county_ledger_form" %> | ||
</p> | ||
|
||
|
||
<%= link_to t(:edit, :scope => :global), edit_ledger_path(@ledger) %> | | ||
<%= link_to t(:back, :scope => :global), edit_account_path(@ledger.account) %> |
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,8 @@ | ||
require 'test_helper' | ||
|
||
class CountyLedgerControllerTest < ActionController::TestCase | ||
# Replace this with your real tests. | ||
test "the truth" do | ||
assert true | ||
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,4 @@ | ||
require 'test_helper' | ||
|
||
class CountyLedgerHelperTest < ActionView::TestCase | ||
end |