Sha256: 765801a16b9d2afc92279cf632dbd659f50785fe1d6b4f46b872fb21b5488938
Contents?: true
Size: 874 Bytes
Versions: 8
Compression:
Stored size: 874 Bytes
Contents
module RailsAdminFeaturedContent class FeaturedContentController < ::ApplicationController def search_content @content_builder = RailsAdminContentBuilder::ContentBuilder.order('date_publish desc').limit(10).search(params[:term]) if @content_builder render json: @content_builder.to_json(:include => { :content_builder_category => {:only => [:name, :slug]} }) else render json: @content_builder.errors end end def create_images @featured_content = FeaturedContent.find(params[:id]) @image = @featured_content.featured_content_images.create(image: params[:featured_content_image]) if @image render json: find_image(@image.id) else render json: @image.errors end end private def find_image(id) FeaturedContentImage.find(id).image.to_json end end end
Version data entries
8 entries across 8 versions & 1 rubygems