Skip to content
Permalink
Browse files

Remove some unused methods and a route

  • Loading branch information
harigopal committed Feb 10, 2020
1 parent c3d8f83 commit e86f2dd624cad6c47c247b61e557cabef04e594b
Showing with 1 addition and 13 deletions.
  1. +0 −12 app/controllers/schools/content_blocks_controller.rb
  2. +1 −1 config/routes.rb
@@ -16,17 +16,5 @@ def create
render json: { error: form.errors.full_messages.join(', ') }
end
end

protected

def content_block_data(content_block)
content_block_data = { id: content_block.id.to_s, content: content_block.content, error: nil }
content_block.file.attached? ? content_block_data.merge!(fileUrl: url_for(content_block.file)) : content_block_data
content_block_data.merge(versions: target_versions)
end

def target_versions
Target.find(params[:target_id]).content_versions.order('version_on DESC').distinct(:version_on).pluck(:version_on)
end
end
end
@@ -50,7 +50,7 @@
end
end

resources :targets, only: %i[update] do
resources :targets, only: [] do
resource :content_block, only: %i[create]
end

0 comments on commit e86f2dd

Please sign in to comment.
You can’t perform that action at this time.