-
Notifications
You must be signed in to change notification settings - Fork 5
Customizing model
Luiz Picolo edited this page Jun 9, 2016
·
2 revisions
content_builder do
only ['ContentBuilder']
end
rails_admin_content_builder
class ContentBuilder < RailsAdminContentBuilder::ContentBuilder
end
path_url = 'admin/content_builder/:id/create_images'
path_method = 'rails_admin_content_builder/content_builder#create_images'
put path_url => path_method
class NewsController < ApplicationController
before_action :set_news, only: [:show, :print]
def index
@news = ContentBuilder.list_all.page(params[:page])
end
def show
end
def list_by_category
@news = ContentBuilder.list_by_category(params[:category]).page(params[:page])
end
def print
render layout: false
end
private
def set_news
@news = ContentBuilder.find_by_slug(params[:slug])
@news.content_builder_count_reads.create
end
end