Skip to content

Commit

Permalink
first working todos - not persisted
Browse files Browse the repository at this point in the history
  • Loading branch information
ybur-yug committed Mar 2, 2015
1 parent 6221f8f commit 497be29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions appname/app/main/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Routes for login and signup, provided by user-templates component gem
get '/signup', _controller: 'user-templates', _action: 'signup'
get '/login', _controller: 'user-templates', _action: 'login'
get '/todos', _action: 'todos'

# The main route, this should be last. It will match any params not
# previously matched.
Expand Down
5 changes: 5 additions & 0 deletions appname/app/main/controllers/main_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ def index
def about
# Add code for when the about view is loaded
end

def add_todo
page._todos << { name: page._new_todo }
page._new_todo = ''
end

private

Expand Down
4 changes: 2 additions & 2 deletions appname/app/main/views/main/main.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<:Title>
{{ template main_path, "title", {controller_group: 'main'} }}

<:Body>
<div class="container">
<div class="header">
<ul class="nav nav-pills pull-right">
<:nav href="/">Home</:nav>
<:nav href="/todos">Todo List</:nav>
<:nav href="/about">About</:nav>
<:user-templates:menu />
</ul>
Expand All @@ -17,7 +17,7 @@ <h3 class="text-muted">appname</h3>
{{ template main_path, 'body', {controller_group: 'main'} }}

<div class="footer">
<p>&copy; Company 2014</p>
<p>&copy; Robert Grayson 2015</p>
</div>

</div>
Expand Down

0 comments on commit 497be29

Please sign in to comment.