diff --git a/app/controllers/miscs_controller.rb b/app/controllers/misc_controller.rb similarity index 52% rename from app/controllers/miscs_controller.rb rename to app/controllers/misc_controller.rb index e2032d0..34660ac 100644 --- a/app/controllers/miscs_controller.rb +++ b/app/controllers/misc_controller.rb @@ -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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index bd8cbc1..48dab23 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/views/miscs/information.html.haml b/app/views/misc/information.html.haml similarity index 100% rename from app/views/miscs/information.html.haml rename to app/views/misc/information.html.haml diff --git a/app/views/shared/_global_nav.html.erb b/app/views/shared/_global_nav.html.erb index 062733e..fb03829 100644 --- a/app/views/shared/_global_nav.html.erb +++ b/app/views/shared/_global_nav.html.erb @@ -21,10 +21,10 @@ <%= link_to_other icon('fa-coffee fa-fw') << " " << t('terms.misc') << icon('fa pull-right fa-caret-down'), misc_path %> diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 67ecf64..c91a91c 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -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 diff --git a/config/locales/translation_ja.yml b/config/locales/translation_ja.yml index c0d37c6..40fbffd 100644 --- a/config/locales/translation_ja.yml +++ b/config/locales/translation_ja.yml @@ -45,7 +45,7 @@ ja: <<: *terms page_title: ユーザー管理 - miscs: + misc: common: &misc_common <<: *terms information: diff --git a/config/routes.rb b/config/routes.rb index a3264ff..b41c889 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/spec/controllers/miscs_controller_spec.rb b/spec/controllers/miscs_controller_spec.rb deleted file mode 100644 index 614e2b7..0000000 --- a/spec/controllers/miscs_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe MiscsController do - -end diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index d93e7b4..d6bb86e 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -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