Noosfero/noosfero

View on GitHub
plugins/community_track/controllers/myprofile/community_track_plugin_myprofile_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class CommunityTrackPluginMyprofileController < MyProfileController
  before_action :allow_edit_track, only: :save_order

  def save_order
    track = profile.articles.find(params[:track])
    track.reorder_steps(params[:step_ids])
    redirect_to track.url
  end

  protected

    def allow_edit_track
      render_access_denied unless profile.articles.find(params[:track]).allow_edit?(user)
    end
end