Clean up routes

This commit is contained in:
uu59 2014-05-22 13:48:18 +09:00
parent 20997db412
commit c4ccb9488c
9 changed files with 11 additions and 17 deletions

View File

@ -1,6 +1,6 @@
class MiscsController < ApplicationController
class MiscController < ApplicationController
def show
redirect_to information_misc_path
redirect_to misc_information_path
end
def information

View File

@ -12,7 +12,7 @@ class UsersController < ApplicationController
unless @user.update_attributes(user_params)
return render :show
end
redirect_to misc_user_path
redirect_to user_path
end
private

View File

@ -21,10 +21,10 @@
<%= link_to_other icon('fa-coffee fa-fw') << " " << t('terms.misc') << icon('fa pull-right fa-caret-down'), misc_path %>
<ul class="nav nav-second-level">
<li>
<%= link_to_other t("miscs.information.page_title"), information_misc_path %>
<%= link_to_other t("misc.information.page_title"), misc_information_path %>
</li>
<li>
<%= link_to_other t('users.show.page_title'), misc_user_path %>
<%= link_to_other t('users.show.page_title'), user_path %>
</li>
</ul>
<!-- /.nav-second-level -->

View File

@ -6,7 +6,7 @@
- @user.errors.full_messages.each do |e|
%div.alert.alert-danger= e
= form_for(:user, url: misc_user_path, method: :patch) do |f|
= form_for(:user, url: user_path, method: :patch) do |f|
%div.form-group
= f.label :name
= f.text_field :name, class: "form-control", disabled: true

View File

@ -45,7 +45,7 @@ ja:
<<: *terms
page_title: ユーザー管理
miscs:
misc:
common: &misc_common
<<: *terms
information:

View File

@ -25,8 +25,7 @@ Rails.application.routes.draw do
end
end
resource :misc, only: :show do
get "information"
resource :user, only: [:show, :edit, :update]
end
get "misc" => "misc#show"
get "misc/information"
resource :user, only: [:show, :edit, :update]
end

View File

@ -1,5 +0,0 @@
require 'spec_helper'
describe MiscsController do
end

View File

@ -2,7 +2,7 @@ describe "users" do
let(:exists_user) { FactoryGirl.create(:user) }
describe "edit" do
let(:url) { misc_user_path }
let(:url) { user_path }
it_should_behave_like "login required"
end