Class: KeywordAttributesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/keyword_attributes_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/keyword_attributes_controller.rb', line 5

def index
  path = params[:path]
  path = "" unless path
  path = File.join("",path)
  user = (=session[:user]) && User.()
  node = Node.find(:first, :conditions => ["path=?",path], :user => user)
  if node
    @kas = node.keyword_attributes
    respond_to do |format|
      format.html
      format.xml { render :xml => @kas}
    end
  else
    respond_to do |format|
      format.html {
        render :text => "not found", :status => :not_found
      }
      format.xml { head :not_found }
    end
  end
end