浏览代码

Stub out /settings.

old-ruby
Ben Kurtovic 9 年前
父节点
当前提交
e1eb40710e
共有 4 个文件被更改,包括 22 次插入10 次删除
  1. +6
    -0
      app/controllers/users_controller.rb
  2. +1
    -0
      app/views/shared/_header.html.erb
  3. +3
    -0
      app/views/users/settings.html.erb
  4. +12
    -10
      config/routes.rb

+ 6
- 0
app/controllers/users_controller.rb 查看文件

@@ -47,4 +47,10 @@ class UsersController < ApplicationController
# do user reset logic
end
end

def settings
if request.post?
# do settings save logic
end
end
end

+ 1
- 0
app/views/shared/_header.html.erb 查看文件

@@ -9,6 +9,7 @@
<ul>
<% if @user %>
<li><%= @user.name %> [<%= Calefaction::EVE.corp_ticker @user.corp_id %>]</li>
<li><%= link_to 'Settings', controller: 'users', action: 'settings' %></li>
<% if @user.admin? %>
<li><%= link_to 'Admin', controller: 'admin', action: 'index' %></li>
<% end %>


+ 3
- 0
app/views/users/settings.html.erb 查看文件

@@ -0,0 +1,3 @@
<% provide(:title, 'Settings') %>

<h1>Account Settings</h1>

+ 12
- 10
config/routes.rb 查看文件

@@ -1,17 +1,19 @@
Rails.application.routes.draw do
root 'tools#index'

get '/signup' => 'users#signup'
post '/signup' => 'users#signup'
get '/login' => 'users#login'
post '/login' => 'users#login'
get '/logout' => 'users#logout'
post '/logout' => 'users#logout'
get '/reset' => 'users#reset'
post '/reset' => 'users#reset'
get '/signup' => 'users#signup'
post '/signup' => 'users#signup'
get '/login' => 'users#login'
post '/login' => 'users#login'
get '/logout' => 'users#logout'
post '/logout' => 'users#logout'
get '/reset' => 'users#reset'
post '/reset' => 'users#reset'
get '/settings' => 'users#settings'
post '/settings' => 'users#settings'

get '/admin' => 'admin#index'
post '/admin' => 'admin#update'
get '/admin' => 'admin#index'
post '/admin' => 'admin#update'

# routes for each tool go here, e.g.:
# get 'tools#campaigns'


正在加载...
取消
保存