diff --git a/app/controllers/recurring_items_controller.rb b/app/controllers/recurring_items_controller.rb index d172c00ab76b4e14b34efd4901873a136743b273..74d806a1093b0caeefd54acd65fb1e8448481ad9 100644 --- a/app/controllers/recurring_items_controller.rb +++ b/app/controllers/recurring_items_controller.rb @@ -9,21 +9,21 @@ class RecurringItemsController < ApplicationController :redirect_to => { :action => :list } def list - @recurring_items_pages, @recurring_items = paginate :recurring_items, :per_page => 10 + @recurring_item_pages, @recurring_items = paginate :recurring_items, :per_page => 10 end def show - @recurring_items = RecurringItems.find(params[:id]) + @recurring_item = RecurringItem.find(params[:id]) end def new - @recurring_items = RecurringItems.new + @recurring_item = RecurringItem.new end def create - @recurring_items = RecurringItems.new(params[:recurring_items]) - if @recurring_items.save - flash[:notice] = 'RecurringItems was successfully created.' + @recurring_item = RecurringItem.new(params[:recurring_item]) + if @recurring_item.save + flash[:notice] = 'RecurringItem was successfully created.' redirect_to :action => 'list' else render :action => 'new' @@ -31,21 +31,21 @@ class RecurringItemsController < ApplicationController end def edit - @recurring_items = RecurringItems.find(params[:id]) + @recurring_item = RecurringItem.find(params[:id]) end def update - @recurring_items = RecurringItems.find(params[:id]) - if @recurring_items.update_attributes(params[:recurring_items]) - flash[:notice] = 'RecurringItems was successfully updated.' - redirect_to :action => 'show', :id => @recurring_items + @recurring_item = RecurringItem.find(params[:id]) + if @recurring_item.update_attributes(params[:recurring_item]) + flash[:notice] = 'RecurringItem was successfully updated.' + redirect_to :action => 'show', :id => @recurring_item else render :action => 'edit' end end def destroy - RecurringItems.find(params[:id]).destroy + RecurringItem.find(params[:id]).destroy redirect_to :action => 'list' end end diff --git a/app/controllers/schedules_controller.rb b/app/controllers/schedules_controller.rb index df6e29280c549b157b7b16df54cc513cbcd3c9a8..5f9315de2c89e56841dee41f8c9a690248602854 100644 --- a/app/controllers/schedules_controller.rb +++ b/app/controllers/schedules_controller.rb @@ -9,21 +9,21 @@ class SchedulesController < ApplicationController :redirect_to => { :action => :list } def list - @schedules_pages, @schedules = paginate :schedules, :per_page => 10 + @schedule_pages, @schedules = paginate :schedule, :per_page => 10 end def show - @schedules = Schedules.find(params[:id]) + @schedule = Schedule.find(params[:id]) end def new - @schedules = Schedules.new + @schedule = Schedule.new end def create - @schedules = Schedules.new(params[:schedules]) - if @schedules.save - flash[:notice] = 'Schedules was successfully created.' + @schedule = Schedule.new(params[:schedule]) + if @schedule.save + flash[:notice] = 'Schedule was successfully created.' redirect_to :action => 'list' else render :action => 'new' @@ -31,21 +31,21 @@ class SchedulesController < ApplicationController end def edit - @schedules = Schedules.find(params[:id]) + @schedule = Schedule.find(params[:id]) end def update - @schedules = Schedules.find(params[:id]) - if @schedules.update_attributes(params[:schedules]) - flash[:notice] = 'Schedules was successfully updated.' - redirect_to :action => 'show', :id => @schedules + @schedule = Schedule.find(params[:id]) + if @schedule.update_attributes(params[:schedule]) + flash[:notice] = 'Schedule was successfully updated.' + redirect_to :action => 'show', :id => @schedule else render :action => 'edit' end end def destroy - Schedules.find(params[:id]).destroy + Schedule.find(params[:id]).destroy redirect_to :action => 'list' end end diff --git a/app/models/recurring_items.rb b/app/models/recurring_items.rb deleted file mode 100644 index d37b33bdf40d148a2c52dace61c5e6a1ff217931..0000000000000000000000000000000000000000 --- a/app/models/recurring_items.rb +++ /dev/null @@ -1,2 +0,0 @@ -class RecurringItems < ActiveRecord::Base -end diff --git a/app/models/schedules.rb b/app/models/schedules.rb deleted file mode 100644 index dad0dec5aa19eb22b6774eb9fac3f3a6ef3e1193..0000000000000000000000000000000000000000 --- a/app/models/schedules.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Schedules < ActiveRecord::Base -end diff --git a/app/views/accounts/edit.rhtml b/app/views/accounts/edit.rhtml index 1596c4d1abe8a030b5b42f9f9e23c5605378f29f..7c0814f6a2a5cf1866408d0eaf9d3d8836d19ef0 100644 --- a/app/views/accounts/edit.rhtml +++ b/app/views/accounts/edit.rhtml @@ -1,4 +1,4 @@ -<h1>Editing account</h1> +<% @heading = "Editing account" %> <%= start_form_tag :action => 'update', :id => @account %> <%= render :partial => 'form' %> diff --git a/app/views/accounts/list.rhtml b/app/views/accounts/list.rhtml index 0e08b7959bed091ff922fbf0950f69d8aae6f5ac..e62595680db0b805dba9a6cc781b78ec850dee3e 100644 --- a/app/views/accounts/list.rhtml +++ b/app/views/accounts/list.rhtml @@ -1,4 +1,4 @@ -<h1>Listing accounts</h1> +<% @heading = "Listing account" %> <table> <tr> diff --git a/app/views/accounts/new.rhtml b/app/views/accounts/new.rhtml index 8a7471ae7888e234866411592543a120e34f1c83..0de083cde8e156b83a39ff3984c0c4cba7de4c62 100644 --- a/app/views/accounts/new.rhtml +++ b/app/views/accounts/new.rhtml @@ -1,4 +1,4 @@ -<h1>New account</h1> +<% @heading = "New account" %> <%= start_form_tag :action => 'create' %> <%= render :partial => 'form' %> diff --git a/app/views/accounts/show.rhtml b/app/views/accounts/show.rhtml index 2e571d22db7a0f1d9712575e7cb9b5bc53ea2a3e..ad01978093169610c969b1724b49e7a4c1b43785 100644 --- a/app/views/accounts/show.rhtml +++ b/app/views/accounts/show.rhtml @@ -1,3 +1,5 @@ +<% @heading = "Show account" %> + <% for column in Account.content_columns %> <p> <b><%= column.human_name %>:</b> <%=h @account.send(column.name) %> diff --git a/app/views/layouts/accounts.rhtml b/app/views/layouts/accounts.rhtml deleted file mode 100644 index ddd9db21eb468b6254a104c3802bd30bc2074017..0000000000000000000000000000000000000000 --- a/app/views/layouts/accounts.rhtml +++ /dev/null @@ -1,13 +0,0 @@ -<html> -<head> - <title>Accounts: <%= controller.action_name %></title> - <%= stylesheet_link_tag 'scaffold' %> -</head> -<body> - -<p style="color: green"><%= flash[:notice] %></p> - -<%= @content_for_layout %> - -</body> -</html> diff --git a/app/views/layouts/saldos.rhtml b/app/views/layouts/saldos.rhtml deleted file mode 100644 index 7e1b441054eabbcd2b76ef9f71895462fc7e87ff..0000000000000000000000000000000000000000 --- a/app/views/layouts/saldos.rhtml +++ /dev/null @@ -1,13 +0,0 @@ -<html> -<head> - <title>Saldos: <%= controller.action_name %></title> - <%= stylesheet_link_tag 'scaffold' %> -</head> -<body> - -<p style="color: green"><%= flash[:notice] %></p> - -<%= @content_for_layout %> - -</body> -</html> diff --git a/app/views/recurring_items/_form.rhtml b/app/views/recurring_items/_form.rhtml index d7bc67534dbdad066f51bea6f993bf5e52d29162..6a8208fad55aaf2356942393e07d857df03f6875 100644 --- a/app/views/recurring_items/_form.rhtml +++ b/app/views/recurring_items/_form.rhtml @@ -1,22 +1,22 @@ -<%= error_messages_for 'recurring_items' %> +<%= error_messages_for 'recurring_item' %> -<!--[form:recurring_items]--> -<p><label for="recurring_items_description">Description</label><br/> -<%= text_field 'recurring_items', 'description' %></p> +<!--[form:recurring_item]--> +<p><label for="recurring_item_description">Description</label><br/> +<%= text_field 'recurring_item', 'description' %></p> -<p><label for="recurring_items_amount">Amount</label><br/> -<%= text_field 'recurring_items', 'amount' %></p> +<p><label for="recurring_item_amount">Amount</label><br/> +<%= text_field 'recurring_item', 'amount' %></p> -<p><label for="recurring_items_startdate">Startdate</label><br/> -<%= date_select 'recurring_items', 'startdate' %></p> +<p><label for="recurring_item_startdate">Startdate</label><br/> +<%= date_select 'recurring_item', 'startdate' %></p> -<p><label for="recurring_items_enddate">Enddate</label><br/> -<%= date_select 'recurring_items', 'enddate', :include_blank => true %></p> +<p><label for="recurring_item_enddate">Enddate</label><br/> +<%= date_select 'recurring_item', 'enddate', :include_blank => true %></p> -<p><label for="recurring_items_created_on">Created on</label><br/> -<%= datetime_select 'recurring_items', 'created_on' %></p> +<p><label for="recurring_item_created_on">Created on</label><br/> +<%= datetime_select 'recurring_item', 'created_on' %></p> -<p><label for="recurring_items_updated_on">Updated on</label><br/> -<%= datetime_select 'recurring_items', 'updated_on' %></p> -<!--[eoform:recurring_items]--> +<p><label for="recurring_item_updated_on">Updated on</label><br/> +<%= datetime_select 'recurring_item', 'updated_on' %></p> +<!--[eoform:recurring_item]--> diff --git a/app/views/recurring_items/_list.rhtml b/app/views/recurring_items/_list.rhtml index 8635f34880a217e0270e5d4da624e59fe4309b1f..2337729c992c2db007f03da73c57777c988a06c3 100644 --- a/app/views/recurring_items/_list.rhtml +++ b/app/views/recurring_items/_list.rhtml @@ -1,7 +1,7 @@ <% ignored_columns = ["created_on", "updated_on"] %> <% sorted_columns = ["description", "amount", "schedule_id"] %> -<% for column in RecurringItems.content_columns %> +<% for column in RecurringItem.content_columns %> <% if not (ignored_columns + sorted_columns).include?(column.name) %> <% sorted_columns << column.name %> <% end %> @@ -11,7 +11,7 @@ <tr> <th colspan="2"> </th> <% for column_name in sorted_columns %> - <th><%= RecurringItems.columns_hash[column_name].human_name %></th> + <th><%= RecurringItem.columns_hash[column_name].human_name %></th> <%end%> <th> </th> </tr> diff --git a/app/views/recurring_items/edit.rhtml b/app/views/recurring_items/edit.rhtml index 4ee50d0a27aa2971a3e75993ae90347e04fb42a1..51d56a8f28a18d6d117426706bb9088b71ad5cfd 100644 --- a/app/views/recurring_items/edit.rhtml +++ b/app/views/recurring_items/edit.rhtml @@ -1,9 +1,9 @@ -<% @heading = "Editing recurring_items" %> +<% @heading = "Editing recurring_item" %> -<%= start_form_tag :action => 'update', :id => @recurring_items %> +<%= start_form_tag :action => 'update', :id => @recurring_item %> <%= render :partial => 'form' %> <%= submit_tag 'Edit' %> <%= end_form_tag %> -<%= link_to 'Show', :action => 'show', :id => @recurring_items %> | +<%= link_to 'Show', :action => 'show', :id => @recurring_item %> | <%= link_to 'Back', :action => 'list' %> diff --git a/app/views/recurring_items/list.rhtml b/app/views/recurring_items/list.rhtml index 21096f2e64d94965d190b15fab171d8df0072776..db38e9f56f7df1fa6654c3689a8220ac5863beeb 100644 --- a/app/views/recurring_items/list.rhtml +++ b/app/views/recurring_items/list.rhtml @@ -1,9 +1,9 @@ -<% @heading = "Listing recurring_items" %> +<% @heading = "Listing recurring_item" %> <%= render :partial => 'list' %> -<%= link_to 'Previous page', { :page => @recurring_items_pages.current.previous } if @recurring_items_pages.current.previous %> -<%= link_to 'Next page', { :page => @recurring_items_pages.current.next } if @recurring_items_pages.current.next %> +<%= link_to 'Previous page', { :page => @recurring_item_pages.current.previous } if @recurring_item_pages.current.previous %> +<%= link_to 'Next page', { :page => @recurring_item_pages.current.next } if @recurring_item_pages.current.next %> <br /> diff --git a/app/views/recurring_items/show.rhtml b/app/views/recurring_items/show.rhtml index 66030352d4839fbb7a9f095441d4d193b1177e63..20881ea58f22cdefcc9b2dc20f49df5f0be9da5e 100644 --- a/app/views/recurring_items/show.rhtml +++ b/app/views/recurring_items/show.rhtml @@ -1,10 +1,10 @@ <% @heading = "Showing recurring_item" %> -<% for column in RecurringItems.content_columns %> +<% for column in RecurringItem.content_columns %> <p> - <b><%= column.human_name %>:</b> <%=h @recurring_items.send(column.name) %> + <b><%= column.human_name %>:</b> <%=h @recurring_item.send(column.name) %> </p> <% end %> -<%= link_to 'Edit', :action => 'edit', :id => @recurring_items %> | +<%= link_to 'Edit', :action => 'edit', :id => @recurring_item %> | <%= link_to 'Back', :action => 'list' %> diff --git a/app/views/schedules/_form.rhtml b/app/views/schedules/_form.rhtml index 97fcbeebadfbdf78bd49b54d7a472532fa9d2798..d29b40ce26400c0671f6fc5cae6cc4f58c807347 100644 --- a/app/views/schedules/_form.rhtml +++ b/app/views/schedules/_form.rhtml @@ -1,16 +1,16 @@ -<%= error_messages_for 'schedules' %> +<%= error_messages_for 'schedule' %> -<!--[form:schedules]--> -<p><label for="schedules_name">Name</label><br/> -<%= text_field 'schedules', 'name' %></p> +<!--[form:schedule]--> +<p><label for="schedule_name">Name</label><br/> +<%= text_field 'schedule', 'name' %></p> -<p><label for="schedules_monthly_repeat">Monthly repeat</label><br/> -<%= text_field 'schedules', 'monthly_repeat' %></p> +<p><label for="schedule_monthly_repeat">Monthly repeat</label><br/> +<%= text_field 'schedule', 'monthly_repeat' %></p> -<p><label for="schedules_created_on">Created on</label><br/> -<%= datetime_select 'schedules', 'created_on' %></p> +<p><label for="schedule_created_on">Created on</label><br/> +<%= datetime_select 'schedule', 'created_on' %></p> -<p><label for="schedules_updated_on">Updated on</label><br/> -<%= datetime_select 'schedules', 'updated_on' %></p> -<!--[eoform:schedules]--> +<p><label for="schedule_updated_on">Updated on</label><br/> +<%= datetime_select 'schedule', 'updated_on' %></p> +<!--[eoform:schedule]--> diff --git a/app/views/schedules/edit.rhtml b/app/views/schedules/edit.rhtml index c624eb9edab0046adbb35d90203843ea0c1adbb1..61837e784a8751cccf59da9825b3970327daaa6d 100644 --- a/app/views/schedules/edit.rhtml +++ b/app/views/schedules/edit.rhtml @@ -1,9 +1,9 @@ <% @heading = "Editing schedule" %> -<%= start_form_tag :action => 'update', :id => @schedules %> +<%= start_form_tag :action => 'update', :id => @schedule %> <%= render :partial => 'form' %> <%= submit_tag 'Edit' %> <%= end_form_tag %> -<%= link_to 'Show', :action => 'show', :id => @schedules %> | +<%= link_to 'Show', :action => 'show', :id => @schedule %> | <%= link_to 'Back', :action => 'list' %> diff --git a/app/views/schedules/list.rhtml b/app/views/schedules/list.rhtml index 2486d890c291fde24a96d00f999a4dc331ce0122..d8f752cc017453f3555f3ce57b88ce0a21d6ba8d 100644 --- a/app/views/schedules/list.rhtml +++ b/app/views/schedules/list.rhtml @@ -2,26 +2,26 @@ <table> <tr> - <% for column in Schedules.content_columns %> + <% for column in Schedule.content_columns %> <th><%= column.human_name %></th> <% end %> </tr> -<% for schedules in @schedules %> +<% for schedule in @schedules %> <tr> - <% for column in Schedules.content_columns %> - <td><%=h schedules.send(column.name) %></td> + <% for column in Schedule.content_columns %> + <td><%=h schedule.send(column.name) %></td> <% end %> - <td><%= link_to 'Show', :action => 'show', :id => schedules %></td> - <td><%= link_to 'Edit', :action => 'edit', :id => schedules %></td> - <td><%= link_to 'Destroy', { :action => 'destroy', :id => schedules }, :confirm => 'Are you sure?', :post => true %></td> + <td><%= link_to 'Show', :action => 'show', :id => schedule %></td> + <td><%= link_to 'Edit', :action => 'edit', :id => schedule %></td> + <td><%= link_to 'Destroy', { :action => 'destroy', :id => schedule }, :confirm => 'Are you sure?', :post => true %></td> </tr> <% end %> </table> -<%= link_to 'Previous page', { :page => @schedules_pages.current.previous } if @schedules_pages.current.previous %> -<%= link_to 'Next page', { :page => @schedules_pages.current.next } if @schedules_pages.current.next %> +<%= link_to 'Previous page', { :page => @schedule_pages.current.previous } if @schedule_pages.current.previous %> +<%= link_to 'Next page', { :page => @schedule_pages.current.next } if @schedule_pages.current.next %> <br /> -<%= link_to 'New schedules', :action => 'new' %> +<%= link_to 'New schedule', :action => 'new' %> diff --git a/app/views/schedules/show.rhtml b/app/views/schedules/show.rhtml index 2f2bd9c1b486ddd9a1f8555fce8b898b95156c83..d8f753a0f6b7a53b9e85fd97b361d26c5b1c53f9 100644 --- a/app/views/schedules/show.rhtml +++ b/app/views/schedules/show.rhtml @@ -1,10 +1,10 @@ <% @heading = "Show schedule" %> -<% for column in Schedules.content_columns %> +<% for column in Schedule.content_columns %> <p> - <b><%= column.human_name %>:</b> <%=h @schedules.send(column.name) %> + <b><%= column.human_name %>:</b> <%=h @schedule.send(column.name) %> </p> <% end %> -<%= link_to 'Edit', :action => 'edit', :id => @schedules %> | +<%= link_to 'Edit', :action => 'edit', :id => @schedule %> | <%= link_to 'Back', :action => 'list' %> diff --git a/public/index.html b/public/index.html index a2daab72b79c8fcf9070a5a34edb324bd2f0ff26..0bb69ba85417794c11d309a2dc7c5f777cdc53cd 100644 --- a/public/index.html +++ b/public/index.html @@ -269,9 +269,18 @@ </li> </ol> </div> + + <div id="application"> + <ul> + <li><a href="accounts">Accounts</a></li> + <li><a href="saldos">Saldos</a></li> + <li><a href="recurring_items">RecurringItems</a></li> + <li><a href="schedules">Schedules</a></li> + </ul> + </div> </div> <div id="footer"> </div> </div> </body> -</html> \ No newline at end of file +</html>