Sha256: 212385bc2e4a24706a8480ac748b4e56af1cc6e4ffb641081daca6727cf63510

Contents?: true

Size: 1.78 KB

Versions: 30

Compression:

Stored size: 1.78 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{
    if @user
      xml.title t('question.user_question', :login_name => @user.username)
      xml.link user_questions_url(@user)
    else
      xml.title t('question.library_group_question', :library_group_name => @library_group.display_name.localize)
      xml.link questions_url
    end
    xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
    xml.language @locale.to_s
    xml.ttl "60"
    if @user
      xml.tag! "atom:link", :rel => 'self', :href => user_questions_url(@user, :format => :rss)
      xml.tag! "atom:link", :rel => 'alternate', :href => user_questions_url(@user)
    else
      xml.tag! "atom:link", :rel => 'self', :href => questions_url(:format => :rss)
      xml.tag! "atom:link", :rel => 'alternate', :href => questions_url
    end
    #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", @questions.offset + 1
      xml.tag! "opensearch:itemsPerPage", @questions.per_page
      #xml.tag! "opensearch:Query", :role => 'request', :searchTerms => params[:query], :startPage => (params[:page] || 1)
    end
    @questions.each do |question|
      xml.item do
        xml.title question.body
        #xml.description(question.title)
        # rfc822
        xml.pubDate question.created_at.utc.rfc822
        xml.link question_url(question)
        xml.guid question_url(question), :isPermaLink => "true"
      end
    end
  }
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
enju_question-0.1.0.pre11 app/views/questions/index.rss.builder
enju_question-0.1.0.pre10 app/views/questions/index.rss.builder
enju_question-0.1.0.pre9 app/views/questions/index.rss.builder
enju_question-0.1.0.pre8 app/views/questions/index.rss.builder
enju_question-0.1.0.pre7 app/views/questions/index.rss.builder
enju_question-0.1.0.pre6 app/views/questions/index.rss.builder
enju_question-0.1.0.pre5 app/views/questions/index.rss.builder
enju_question-0.1.0.pre4 app/views/questions/index.rss.builder
enju_question-0.1.0.pre3 app/views/questions/index.rss.builder
enju_question-0.1.0.pre2 app/views/questions/index.rss.builder
enju_question-0.1.0.pre app/views/questions/index.rss.builder
enju_question-0.0.21 app/views/questions/index.rss.builder
enju_question-0.0.20 app/views/questions/index.rss.builder
enju_question-0.0.19 app/views/questions/index.rss.builder
enju_question-0.0.18 app/views/questions/index.rss.builder
enju_question-0.0.17 app/views/questions/index.rss.builder
enju_question-0.0.16 app/views/questions/index.rss.builder
enju_question-0.0.15 app/views/questions/index.rss.builder
enju_question-0.0.14 app/views/questions/index.rss.builder
enju_question-0.0.13 app/views/questions/index.rss.builder