From e0cdedfa2ee45afe3d3afad57179560a33be0ff8 Mon Sep 17 00:00:00 2001 From: chris2tof Date: Tue, 6 Dec 2011 18:12:12 +0800 Subject: [PATCH] Remove useless controller and view user_attributes_controller and user_attributes views --- app/assets/javascripts/user_attribute_form.js | 10 ----- .../admin/user_attributes_controller.rb | 43 ------------------- .../admin/user_attributes/_form.html.erb | 32 -------------- app/views/admin/user_attributes/edit.html.erb | 12 ------ .../admin/user_attributes/index.html.erb | 23 ---------- app/views/admin/user_attributes/new.html.erb | 17 -------- 6 files changed, 137 deletions(-) delete mode 100644 app/assets/javascripts/user_attribute_form.js delete mode 100644 app/controllers/admin/user_attributes_controller.rb delete mode 100644 app/views/admin/user_attributes/_form.html.erb delete mode 100644 app/views/admin/user_attributes/edit.html.erb delete mode 100644 app/views/admin/user_attributes/index.html.erb delete mode 100644 app/views/admin/user_attributes/new.html.erb diff --git a/app/assets/javascripts/user_attribute_form.js b/app/assets/javascripts/user_attribute_form.js deleted file mode 100644 index 3af8dc01..00000000 --- a/app/assets/javascripts/user_attribute_form.js +++ /dev/null @@ -1,10 +0,0 @@ -var new_one = $('fieldset #new_one').clone(); -$('fieldset #new_one').remove(); - -$('fieldset a.remove').live( "click", function(){ - $(this).parent().remove(); -}); - -$('fieldset a.add').click(function(){ - new_one.clone().appendTo( $('fieldset') ); -}) \ No newline at end of file diff --git a/app/controllers/admin/user_attributes_controller.rb b/app/controllers/admin/user_attributes_controller.rb deleted file mode 100644 index c7021c74..00000000 --- a/app/controllers/admin/user_attributes_controller.rb +++ /dev/null @@ -1,43 +0,0 @@ -class Admin::UserAttributesController < ApplicationController - - layout "admin" - before_filter :authenticate_user! - - def index - @user_attributes = UserAttribute.all - end - - def show - @user_attribute = UserAttribute.find(params[:id]) - end - - def new - @user_attribute = UserAttribute.new - end - - def edit - @user_attribute = UserAttribute.find(params[:id]) - end - - def create - @user_attribute = UserAttribute.new(params[:user_attribute]) - @user_attribute.save - - redirect_to :action => :index - end - - def update - @user_attribute = UserAttribute.find(params[:id]) - @user_attribute.update_attributes(params[:user_attribute]) - - redirect_to :action => :index - end - - def destroy - @user_attribute = UserAttribute.find(params[:id]) - @user_attribute.destroy - - redirect_to :action => :index - end - -end diff --git a/app/views/admin/user_attributes/_form.html.erb b/app/views/admin/user_attributes/_form.html.erb deleted file mode 100644 index 98953d2c..00000000 --- a/app/views/admin/user_attributes/_form.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -

- <%= f.label :name %> - <%= f.text_field :name %> -

- -
- <% @user_attribute.attrs.each_with_index do |attr, i| %> -

- - <%= hidden_field_tag "user_attribute[attrs][][key]", attr["key"] %> - <%= text_field_tag "user_attribute[attrs][][name]", attr["name"] %> - <%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field", "select"], attr["type"]) %> - (remove) -

- <% end -%> - -

- - <%= text_field_tag "user_attribute[attrs][][key]", "" %> - - <%= text_field_tag "user_attribute[attrs][][name]", "" %> - <%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field"], "") %> - (remove) -

- - (add) - -
- -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "user_attribute_form" %> -<% end -%> \ No newline at end of file diff --git a/app/views/admin/user_attributes/edit.html.erb b/app/views/admin/user_attributes/edit.html.erb deleted file mode 100644 index 1bc86bc4..00000000 --- a/app/views/admin/user_attributes/edit.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - -

Editing user attribute: <%= @user_attribute.key %>

- -<% form_for @user_attribute, :url => admin_user_attribute_path(@user_attribute) do |f| %> - - <%= render :partial => "form", :locals => { :f => f } %> - -

- <%= f.submit %> -

- -<% end -%> diff --git a/app/views/admin/user_attributes/index.html.erb b/app/views/admin/user_attributes/index.html.erb deleted file mode 100644 index c9fe93b4..00000000 --- a/app/views/admin/user_attributes/index.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -

Listing user attributes

- - - - - - - - - -<% @user_attributes.each do |user_attribute| %> - - - - - - -<% end %> -
名稱Key
<%= user_attribute.name %><%= user_attribute.key %><%= link_to t(:edit), edit_admin_user_attribute_path(user_attribute) %><%= link_to t(:delete), admin_user_attribute_path(user_attribute), :confirm => 'Are you sure?', :method => :delete %>
- -
- -<%= link_to t(:new_user_attribute, :scope => :admin), new_admin_user_attribute_path, :class => 'button positive' %> \ No newline at end of file diff --git a/app/views/admin/user_attributes/new.html.erb b/app/views/admin/user_attributes/new.html.erb deleted file mode 100644 index c2ada3c1..00000000 --- a/app/views/admin/user_attributes/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - -

New user attribute: <%= @user_attribute.key %>

- -<% form_for @user_attribute, :url => admin_user_attributes_path do |f| %> - -

- <%= f.label :key, "Key" %> - <%= f.text_field :key %> -

- - <%= render :partial => "form", :locals => { :f => f } %> - -

- <%= f.submit %> -

- -<% end -%>