0

我的应用程序要求用户提供他们的提要 url 地址。我正在尝试将提要 url 传递给 Feedzirra 以获取和解析 url,但我没有任何运气。

我究竟做错了什么:

这是我的控制器显示方法

# 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
4

1 回答 1

0
url  = :url
feed = Feedzirra::Feed.fetch_and_parse(url)

Here the url variable will always be a symbol with its value :url. Don't think this is what you want.

于 2013-07-29T05:46:55.850 回答