Sha256: 03b16c2b6550ad4db3be0bad018849d3038ce88d4a59c3e2b156bf8f6bdb4a49

Contents?: true

Size: 1.63 KB

Versions: 8

Compression:

Stored size: 1.63 KB

Contents

xml.instruct! :xml, :version=>"1.0"
xml.rss('version' => "2.0",
  'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
  'xmlns:atom' => "http://www.w3.org/2005/Atom"){
  xml.channel{
    xml.title t('answer.user_answer', :login_name => @user.username)
    xml.link "#{request.protocol}#{request.host_with_port}" + user_answers_path(@user)
    xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
    xml.language @locale.to_s
    xml.ttl "60"
    xml.tag! "atom:link", :rel => 'self', :href => "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => :rss, :only_path => true))}"
    xml.tag! "atom:link", :rel => 'alternate', :href => "#{request.protocol}#{request.host_with_port}"
    #xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port}/page/opensearch"
    unless params[:query].blank?
      xml.tag! "opensearch:totalResults", @count[:query_result]
      xml.tag! "opensearch:startIndex", @answers.offset + 1
      xml.tag! "opensearch:itemsPerPage", @answers.per_page
      #xml.tag! "opensearch:Query", :role => 'request', :searchTerms => params[:query], :startPage => (params[:page] || 1)
    end
    @answers.each do |answer|
      xml.item do
        xml.title answer.body
        #xml.description(answer.title)
        # rfc822
        xml.pubDate answer.created_at.utc.rfc822
        xml.link "#{request.protocol}#{request.host_with_port}" + answer_path(answer)
        xml.guid "#{request.protocol}#{request.host_with_port}" + answer_path(answer), :isPermaLink => "true"
      end
    end
  }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
enju_question-0.0.21 app/views/answers/index.rss.builder
enju_question-0.0.20 app/views/answers/index.rss.builder
enju_question-0.0.19 app/views/answers/index.rss.builder
enju_question-0.0.18 app/views/answers/index.rss.builder
enju_question-0.0.17 app/views/answers/index.rss.builder
enju_question-0.0.16 app/views/answers/index.rss.builder
enju_question-0.0.15 app/views/answers/index.rss.builder
enju_question-0.0.14 app/views/answers/index.rss.builder