Class: Role::ActivitiesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/lesli_guard/role/activities_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexHTML|JSON

The HTTP request has to specify wheter the HTML or the JSON text should be rendered

Examples:

# Executing this controller's action from javascript's frontend
this.http.get(`127.0.0.1/administration/roles/1/activities.json`);

Returns:

  • (HTML|JSON)

    HTML view for listing all activities associated to a role



42
43
44
45
46
47
48
49
50
51
# File 'app/controllers/lesli_guard/role/activities_controller.rb', line 42

def index
    respond_to do |format|
        format.html {}
        format.json do
            return respond_with_not_found unless @role

            respond_with_successful(Role::Activity.index(@role, @query))
        end
    end
end

#optionsJson

Returns Json that contains all the information needed to create a new role_activity.

Examples:

# Executing this controller's action from javascript's frontend
this.http.get('127.0.0.1/house/options/projects')

Returns:

  • (Json)

    Json that contains all the information needed to create a new role_activity



59
60
61
# File 'app/controllers/lesli_guard/role/activities_controller.rb', line 59

def options
    respond_with_successful(Role::Activity.options(current_user, @query))
end