Sha256: c9ece62b19190186cdb42fa8fbcabb1d01264d33b50d9cbf2c9630e409d287a0

Contents?: true

Size: 1.61 KB

Versions: 11

Compression:

Stored size: 1.61 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))}"
    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

11 entries across 11 versions & 1 rubygems

Version Path
enju_question-0.0.13 app/views/answers/index.rss.builder
enju_question-0.0.12 app/views/answers/index.rss.builder
enju_question-0.0.11 app/views/answers/index.rss.builder
enju_question-0.0.10 app/views/answers/index.rss.builder
enju_question-0.0.9 app/views/answers/index.rss.builder
enju_question-0.0.8 app/views/answers/index.rss.builder
enju_question-0.0.7 app/views/answers/index.rss.builder
enju_question-0.0.6 app/views/answers/index.rss.builder
enju_question-0.0.5 app/views/answers/index.rss.builder
enju_question-0.0.4 app/views/answers/index.rss.builder
enju_question-0.0.3 app/views/answers/index.rss.builder