Sha256: 09910dc6c6ab14cc09526657d126b69d1fb457defa1025d1462df68e4c631735
Contents?: true
Size: 1 KB
Versions: 10
Compression:
Stored size: 1 KB
Contents
class E9Crm::EmailTemplatesController < E9Crm::ResourcesController defaults include E9Rails::Controllers::Orderable self.should_paginate_index = false filter_access_to :select, :require => :read, :context => :admin before_filter :handle_unacceptable_mimetype, :only => :show respond_to :json, :only => :show respond_to :html, :except => :show def select index! end def show unless params[:contact_id] =~ /\d+/ && @contact = Contact.find_by_id(params[:contact_id]) head :status => 404 else object = resource object.contact = @contact object.recipient = params[:user_id] =~ /\d+/ && @contact.users.find_by_id(params[:user_id]) || @contact.primary_user render :json => object end end protected def collection @email_templates ||= end_of_association_chain.order(:name).all end def default_ordered_on 'name' end def default_ordered_dir 'ASC' end def determine_template request.xhr? ? false : super end end
Version data entries
10 entries across 10 versions & 1 rubygems