我的应用会询问用户他们的Feed网址。我正在尝试将Feed网址传递给Feedzirra以获取并解析网址,但我没有任何运气。
我做错了什么:
这是我在控制器中的show方法
# GET /scores/1
# GET /scores/1.json
def show
#@score=Score.find(params[:id])
@score = current_user.scores.find(params[:id])
url=:url
feed=Feedzirra::Feed.fetch_and_parse(url)
@entry=feed.entries
respond_to do |format|
format.html #show.html.erb
format.json {render json: @score }
end
模型
class Score < ActiveRecord::Base
belongs_to :user
validates :user_id, presence: true
attr_accessible :title, :postFrequency, :editorialCalendar, :postTemplate,
:headlineVariations, :publishingScore, :professionalLogo, :colorScheme, :typographyStandards,
:seoPlugin, :googleAnalytics, :setupScore, :sb_promotion_1, :sb_promotion_2, :sb_recentPosts,
:sidebarScore, :leadMagnet, :emailCampaign, :productCreated, :landingPage, :monetizationScore, :url,
:name, :summary, :url, :published_at, :guid
end
答案 0 :(得分:0)
url = :url
feed = Feedzirra::Feed.fetch_and_parse(url)
此处url
变量将始终为其值:url
的符号。不要以为这就是你想要的。