diff --git a/app/controllers/contact_group_controller.rb b/app/controllers/contact_groups_controller.rb similarity index 78% rename from app/controllers/contact_group_controller.rb rename to app/controllers/contact_groups_controller.rb index 8654d45..4bdb75d 100644 --- a/app/controllers/contact_group_controller.rb +++ b/app/controllers/contact_groups_controller.rb @@ -1,17 +1,9 @@ -class Contacts::ContactGroupController < ApplicationController - - uses_component_template_root - - model :contact_group +class ContactGroupsController < ApplicationController layout 'public' def index - redirect_to(:action=>"list") - end - - def list - @contactgroup = ContactGroup.new - @contactgroup.customer_id = logged_user + @contact_group = ContactGroup.new + @contact_group.customer_id = logged_user @contactgroups = ContactGroup.find_by_user(logged_user) end diff --git a/app/views/contact_group/edit.rhtml b/app/views/contact_groups/edit.rhtml similarity index 100% rename from app/views/contact_group/edit.rhtml rename to app/views/contact_groups/edit.rhtml diff --git a/app/views/contact_group/list.rhtml b/app/views/contact_groups/index.html.erb similarity index 94% rename from app/views/contact_group/list.rhtml rename to app/views/contact_groups/index.html.erb index 4043cae..a3dc585 100644 --- a/app/views/contact_group/list.rhtml +++ b/app/views/contact_groups/index.html.erb @@ -1,6 +1,6 @@

<%=_('Contact Groups')%>

-
+<%- form_for @contact_group do |f| %> <%= hidden_field "contactgroup", "user_id" %> @@ -23,4 +23,4 @@
-
\ No newline at end of file +<%- end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 27e1ecc..8355bff 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -60,3 +60,4 @@ en: add_one_contact: Add one contact add_multiple: Add multiple name: name + diff --git a/config/routes.rb b/config/routes.rb index 1b1ad03..6ebc797 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ ActionController::Routing::Routes.draw do |map| map.resources :folders, :requirements => {:id => /[^\/]+/} map.resources :contacts + map.resources :contact_groups # Add your own custom routes here. # The priority is based upon order of creation: first created -> highest priority.