-
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.
Added validations, Added content in Home page
- Loading branch information
1 parent
ac62e90
commit 3c01a83
Showing
7 changed files
with
44 additions
and
3 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 |
---|---|---|
|
@@ -30,6 +30,9 @@ def update | |
end | ||
|
||
def destroy | ||
if @category.destroy | ||
redirect_to categories_path | ||
end | ||
end | ||
|
||
def index | ||
|
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,4 +1,7 @@ | ||
class Category < ActiveRecord::Base | ||
belongs_to :user | ||
has_many :expenses | ||
|
||
validates :name , uniqueness: true | ||
validates :name , presence: true | ||
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
class Expense < ActiveRecord::Base | ||
belongs_to :category | ||
belongs_to :user | ||
|
||
validates :amount, :category, :date, :description, presence: true | ||
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 |
---|---|---|
@@ -1,4 +1,16 @@ | ||
<h1> Expence Manager </h1> | ||
<p>Manage all your expences with hassle free </p> | ||
|
||
<div class="well"> | ||
<%= link_to "+ Add Expense", new_expense_path, class: "btn btn-small btn-success" %> | ||
<%= link_to "+ Add Category", new_category_path, class: "btn btn-small btn-success" %> | ||
</div> | ||
|
||
<p>Manage all your expences with hassle free </p> | ||
<h3>Benefits:</h3> | ||
<ul> | ||
<li>sorting the expenditures based on the categories.</li> | ||
<li>sorting the expenditures based on the period of time.</li> | ||
<li>Addition & deletion of personal categories.</li> | ||
<li>Graph charts based on certain time periods.</li> | ||
<li>Download all the expense list in the excel sheet</li> | ||
</ul> |