Tag: feed

从有关rails图表api的post中删除“通过APP_NAME”

目前,我正在使用RestClient向朋友的时间线发布简单的post。 RestClient.post ‘https://graph.facebook.com/_friend_/feed’, :access_token => “_token_”, :message => “_message_” 这样可行,但当它显示在我朋友的时间轴上时,post底部会显示“通过APP_NAME”的文字。 有没有办法摆脱它?

如何添加多态注释到Feed?

我正在尝试允许用户直接在他们的活动源上添加和查看评论,而不必去显示页面,这是我在这个railscast剧集中所做的: http ://railscasts.com/episodes/ 154-多态关联 – 修订 。 我从头开始创建活动源。 以下是我所做的尝试之一。 我将逻辑直接添加到索引操作中: class ActivitiesController < ApplicationController def index @activities = Activity.order("created_at desc").where(current_user.following_ids) @activity = Activity.find(params[:id]) @commentable = @activity @comments = @commentable.comments @comment = Comment.new end end 它告诉我: ActiveRecord::RecordNotFound in ActivitiesController#index Couldn’t find Activity with ‘id’= 我试图直接在活动索引中呈现注释部分: 评论/意见和评论/表格 Comment activity.rb class Activity < ActiveRecord::Base belongs_to :user has_many :comments, […]

如何使用私人提交来隐藏Feed?

在评估表单中,有一个提交按钮和一个按钮。 如果单击私人提交,则提交的信息将隐藏给查看该个人资料的其他用户。 我们如何使用来隐藏提交的信息以显示在Feed上? 活动/ index.html.erb Feed #We’d need to make .public_valuations work with this without getting an undefined method error. activities_controller.rb class ActivitiesController < ApplicationController def index @activities = PublicActivity::Activity.order("created_at desc").where(owner_id: current_user.following_ids, owner_type: "User") end end 为简洁起见,我只会包含_create (还有update和destroy )。 每次用户提交评估时,它都会在Feed上弹出,我们怎样才能显示public_valuations ? public_activity /评估/ _create.html.erb which has since been removed valuation.rb class Valuation (controller, model) { […]