mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 06:06:56 +08:00
7dcc774414
* Remove redundant use of respond_to in controlller actions with just one responder format [SCI-8811] * Remove redundant begin block and replace 303 status code with :see_other [SCI-8811]
26 lines
541 B
Ruby
26 lines
541 B
Ruby
class ProjectActivitiesController < ApplicationController
|
|
before_action :load_vars, only: [ :index ]
|
|
before_action :check_view_permissions, only: [ :index ]
|
|
|
|
def index
|
|
@activities = @project.last_activities
|
|
|
|
render json: {
|
|
html: render_to_string({ partial: 'index', formats: :html })
|
|
}
|
|
end
|
|
|
|
private
|
|
|
|
def load_vars
|
|
@project = Project.find_by_id(params[:project_id])
|
|
unless @project
|
|
render_404
|
|
end
|
|
end
|
|
|
|
def check_view_permissions
|
|
render_403 unless can_read_project?(@project)
|
|
end
|
|
|
|
end
|