Sha256: 04f077df5621136b205b85ae728981d8b589a481c4841e666908642b63db57e4
Contents?: true
Size: 1.12 KB
Versions: 10
Compression:
Stored size: 1.12 KB
Contents
class Admin::GalleryImagesController < Admin::AdminController belongs_to :gallery def create create! do |success, failure| success.js { render :json => { :id => resource.id, :gallery_id => resource.gallery_id }, :content_type => 'text/html' } failure.js { render :json => { :result => 'error'}, :content_type => 'text/html' } # IE sends post as html... lame success.html { render :json => { :id => resource.id, :gallery_id => resource.gallery_id }, :content_type => 'text/html' } failure.html { render :json => { :result => 'error'}, :content_type => 'text/html' } end end def update update! do |success, failure| success.html{ redirect_to edit_admin_gallery_path(resource.gallery) } success.js{ render :js => "flash_notice('Updated Successfully')" } end end def image render :partial => "admin/galleries/image", :locals => {:image => GalleryImage.find(params[:gallery_image_id])}, :layout => false end end
Version data entries
10 entries across 10 versions & 1 rubygems