Project

General

Profile

« Previous | Next » 

Revision b16f321a

Added by Corey Osman about 12 years ago

  • ID b16f321a47640336c8dead7dfd9dc3f0fdeb30da

fixes #1524 Add more attributes to JSON host index

Signed-off-by: Corey Osman <>

View differences:

app/controllers/hosts_controller.rb
# rendering index page for non index page requests (out of sync hosts etc)
render :index if title and @title = title
end
format.json { render :json => search.all(:select => "hosts.name", :include => included_associations).map(&:name) }
# should you ever need more attributes just add to the :only array or specify :methods, :include, :except to the options hash
format.json { render :json => search.to_json({:only => ["name", "id", "hostgroup_id", "operatingsystem_id"]})}
format.yaml do
render :text => if params["rundeck"]
result = {}

Also available in: Unified diff