Ruby on rails 未初始化的常量ActionView::CompiledTemplates::FB Ruby on Rails

Ruby on rails 未初始化的常量ActionView::CompiledTemplates::FB Ruby on Rails,ruby-on-rails,facebook,Ruby On Rails,Facebook,我正在使用ruby 1.9.3 Rails 3.2.13制作一个应用程序,可以通过一个对话框(提要对话框)在facebook墙上发布 在我看来- <% FB.ui( { method: 'feed', name: 'The Facebook SDK for Javascript', caption: 'Bringing Facebook to the desktop and mobile web', description: ( 'A small J

我正在使用ruby 1.9.3 Rails 3.2.13制作一个应用程序,可以通过一个对话框(提要对话框)在facebook墙上发布

在我看来-

<%
FB.ui(
  {
   method: 'feed',
   name: 'The Facebook SDK for Javascript',
   caption: 'Bringing Facebook to the desktop and mobile web',
   description: (
      'A small JavaScript library that allows you to harness ' +
      'the power of Facebook, bringing the user\'s identity, ' +
      'social graph and distribution power to your site.'
   ),
   link: 'https://developers.facebook.com/docs/reference/javascript/',
   picture: 'http://www.fbrell.com/public/f8.jpg'
  },
  function(response) {
    if (response && response.post_id) 
      alert('Post was published.')
     else 
      alert('Post was not published.')
    end
  }
);
%>
在FB.ui行上。。
请帮助我,我是新来的

看起来您试图在视图中混合使用Ruby和JavaScript,但您只需要JavaScript。尝试删除erb标签
无论“FB”类是什么,它都不可用。你需要安装gem吗?我之前已经安装了'xmpp4r_facebook',facebook javascript sdk没有安装;I don’我不需要任何……FB法在哪里使用?
def func
cache_expire = 1.year
response.headers["Pragma"] = "public"
response.headers["Cache-Control"] = "max-age=#{cache_expire.to_i}"
response.headers["Expires"] = (Time.now + cache_expire).strftime("%d %m %Y %H:%I:%S %Z")
render :layout => false, :inline => "<script src='//connect.facebook.net/en_US/all.js'></script>"
  redirect_to root_path
end
uninitialized constant ActionView::CompiledTemplates::FB