Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6001457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:50:15+00:00 2026-05-23T00:50:15+00:00

Am having trouble getting the Atom feed function to work on my blog. I

  • 0

Am having trouble getting the Atom feed function to work on my blog. I am using the Kaminari plug-in to paginate my articles – 6 per page. With the code below, when a user clicks on the RSS Feed image they are asked to log-in instead of subscribing to the feed! Any help would be appreciated with this issue…

screenshot

application.html.erb

page head <%= auto_discovery_link_tag(:atom, feed_path, { :title => “My ATOM Feed” }) %>

page body <%= image_tag(“feed.png”, {:alt => ‘Atom feed’, :class=>”feed”}) %>Subscribe

routes.rb

match '/feed' => 'articles#feed', :as => :feed, :defaults => { :format => 'atom' }

articles_controller

class ArticlesController < ApplicationController

before_filter :authenticate_user!, :except => [:index, :show]

# GET /articles
# GET /articles.xml
# display articles on the home page

def index
@articles = Article.published.page(params[:page]).per(6).ordered

respond_to do |format|
  format.html # index.html.erb
  format.xml  { render :xml => @articles }
  format.atom { render :atom => @articles }
end
end


# GET /articles/1
# GET /articles/1.xml
def show
@article = Article.find(params[:id])
@comment = Comment.new(:article=>@article)

respond_to do |format|
  format.html # show.html.erb
  format.xml  { render :xml => @article }
end
end



# GET /articles/new
# GET /articles/new.xml
def new
@article = Article.new

respond_to do |format|
  format.html # new.html.erb
  format.xml  { render :xml => @article }
end
end


# GET /articles/1/edit
def edit
@article = Article.find(params[:id])
authorize! :edit, @article
end

# POST /articles
# POST /articles.xml
def create
  #authorize! :create, @article
  @article = Article.new(params[:article])
  @article.user_id = current_user.id

respond_to do |format|
  if @article.save
    format.html { redirect_to(@article, :notice => 'Worry was successfully created.') }
    format.xml  { render :xml => @article, :status => :created, :location => @article }
  else
    format.html { render :action => "new" }
    format.xml  { render :xml => @article.errors, :status => :unprocessable_entity }
  end
end
end

# PUT /articles/1
# PUT /articles/1.xml
def update
  @article = Article.find(params[:id])
authorize! :update, @article
respond_to do |format|
  if @article.update_attributes(params[:article])
    format.html { redirect_to(@article, :notice => 'Worry was successfully updated.') }
    format.xml  { head :ok }
  else
    format.html { render :action => "edit" }
    format.xml  { render :xml => @article.errors, :status => :unprocessable_entity }
  end
end
end


# DELETE /articles/1
# DELETE /articles/1.xml
def destroy
@article = Article.find(params[:id])
authorize! :destroy, @article
@article.destroy

respond_to do |format|
  format.html { redirect_to(articles_url) }
  format.xml  { head :ok }
end
end

end

views/articles/feed.atom.builder

atom_feed :language => 'en-US' do |feed|
feed.title "mysite.com"
feed.updated(@articles.blank? ? Time.now : @articles.first.created_at)

@articles.each do |article|
feed.entry article, :published => article.accepted do |entry|
  entry.title article.title

  entry.author do |author|
    author.name article.user.fullname
  end
end
end
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:50:16+00:00Added an answer on May 23, 2026 at 12:50 am

    Update this line in your articles_controller:

    before_filter :authenticate_user!, :except => [:index, :show]
    

    … with:

    before_filter :authenticate_user!, :except => [:index, :show, :feed]
    

    This will prevent the request for authentication.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble getting my dll to work when using explicit linking. Using implicit
I’m having trouble getting a AJAX/JSON function to work correctly. I had this function
Having trouble getting the following code to work: $('#changeMode').button().click(function(){ $('#playfield').toggle(function() { $(this).switchClass(gridView,plainView); }, function()
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers.
I'm having trouble getting the following to work in SQL Server 2k, but it
Having trouble getting this to work. What's strange is that I have 10 bookmarks
I having trouble getting append() to work in safari for some reason, but it
I'm having trouble getting django-admin.py to work... it's in this first location: /Users/mycomp/bin/ but
I'm having trouble getting the following JQuery script to function properly - its functionality
Im having trouble getting a function within a function working, do you think what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.