[Facebooker-talk] convert_options_to_javascript_without_facebooker breaking link_to?

Adeel Ahmad adeel at proletariandesign.com
Thu Jan 22 13:26:27 EST 2009


Hello Richard,

Thanks so much for your help. I'm using Rails 1.2.5. Here are the trace and
index.rhtml:


Full trace:

/Users/macmini/Projects/Git/myapp/vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_helper.rb:94:in
`convert_options_to_javascript_without_facebooker!'
/Users/macmini/Projects/Git/myapp/vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_helper.rb:94:in
`convert_options_to_javascript!'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:69:in
`link_to'
/Users/macmini/Projects/Git/myapp/app/views/main/index.rhtml:18:in
`_run_rhtml_47app47views47main47index46rhtml'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_view/base.rb:325:in
`send'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_view/base.rb:325:in
`compile_and_render_template'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_view/base.rb:301:in
`render_template'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_view/base.rb:260:in
`render_file'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/base.rb:812:in
`render_file'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/base.rb:717:in
`render_with_no_layout'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/layout.rb:247:in
`render_without_benchmark'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render_without_trace_View____determine_metric_path__Rendering'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render_without_trace_View____determine_metric_path__Rendering'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/method_tracer.rb:118:in
`render'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/method_tracer.rb:38:in
`trace_method_execution'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/method_tracer.rb:117:in
`render'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/base.rb:1102:in
`perform_action_without_filters'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/filters.rb:696:in
`call_filters'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/filters.rb:688:in
`perform_action_without_benchmark'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
`perform_action_without_newrelic_trace'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/instrumentation/action_controller.rb:63:in
`perform_action'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/method_tracer.rb:38:in
`trace_method_execution'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/instrumentation/action_controller.rb:52:in
`perform_action'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/method_tracer.rb:38:in
`trace_method_execution'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/instrumentation/action_controller.rb:46:in
`perform_action'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/base.rb:435:in
`send'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/base.rb:435:in
`process_without_filters'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/filters.rb:684:in
`process_without_session_management_support'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
`process'
/Users/macmini/Projects/Git/myapp/vendor/rails/actionpack/lib/action_controller/base.rb:334:in
`process'
/Users/macmini/Projects/Git/myapp/vendor/rails/railties/lib/dispatcher.rb:41:in
`dispatch_without_newrelic'
/Users/macmini/Projects/Git/myapp/vendor/plugins/newrelic_rpm/lib/newrelic/agent/instrumentation/dispatcher.rb:73:in
`dispatch'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in
`process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in
`synchronize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in
`process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
`process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in
`run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
`run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in
`run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
`load'
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
`load'
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:488:in
`load'
/Users/macmini/Projects/Git/myapp/vendor/rails/railties/lib/commands/servers/mongrel.rb:60
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/Users/macmini/Projects/Git/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in
`require'
/Users/macmini/Projects/Git/myapp/vendor/rails/railties/lib/commands/server.rb:39
script/server:3:in `require'
script/server:3


Index.rhtml:

<% unless logged_in? %>
    <div>
        <%= render :partial => 'explain' %>
    </div>
<% end %>
<div id="colOne">
    <%= link_to image_tag("blog_small_1.jpg", :alt => "myapp Blog"), :action
=> "myapp", :controller => "blogs" %>
</div>
<div id="colTwo">
  <div class="section_title">
    <span style="float: right">
            <%= link_to image_tag("postobj.png", :alt => "Submit new
product", :class => 'post'), :action => "new",
                      :controller => "products" %>
    </span>
    <%= image_tag("7151238_6.png", :alt => ' ', :style => 'padding: 3px 3px
0 0;') %>
    <span style = "vertical-align: top">Latest products</span>
  </div>
    <%= link_to "(view all)", {:controller => "products", :action =>
"index"}, :style => "float: right;") %><br/>
  <%= render :partial => 'product', :collection => @products %>
  <br clear="all"/>
    <br/>
  <div class="section_title">
    <span style = "vertical-align: top">Newest</span>
  </div>
    <%= render :partial => 'users/people' %>
</div>
<div id="colThree">
  <div class="section_title">
    <span style="float: right">
        <%= link_to image_tag("postobj.png", :alt => "Submit new event",
:class => 'post'), :action => "new",
                      :controller => "events" %>
    </span>
      <%= image_tag("7151238_3.png", :alt => ' ', :style => 'padding: 3px
3px 0 0;') %>
    <span style = "vertical-align: top">New events</span>
  </div>
  <div id="eventlist">
        <%= link_to '(view all)', {:controller => 'events', :action =>
'index'}, :style => 'float: right;' %><br/>
    <%= render :partial => 'event', :collection => @events %>
  </div>
  <br clear="all"/>
</div>


- Adeel



On Thu, Jan 22, 2009 at 8:37 AM, Richard Jordan
<jordanr at cs.washington.edu>wrote:

> Dear Adeel,
>
> No, if you're hitting localhost, everything Rails should work.
>
> What error exactly do you get?  I tried your code but must've done it
> differently.  I have a view:
>
> # index.html.erb
> <%= link_to "(view all)", {:controller => "products", :action => "index"},
> :style => "float: right;" %>
>
> I go to my localhost:port, and the link_to floats to the right. This should
> completely bypass Facebooker.  It does for me.
>
> I can nail down the problem if you post your (1) full error trace and (2)
> exact code for view.html.erb.
>
> And what Rails version? (though it shouldn't matter).
>
> Sincerely,
> Richard
>
>
>
> On Thu, 22 Jan 2009, Adeel Ahmad wrote:
>
>  I've got Facebooker installed on my app but as soon as I start my app
>>
> and go
>
>> to localhost:3000 I get the following error:
>>
>>
>> .../vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_helper.rb:94:in
>
>> `convert_options_to_javascript_without_facebooker!'
>>
>> .../vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_helper.rb:94:in
>
>> `convert_options_to_javascript!'
>> .../vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:69:in
>> `link_to'
>> .../app/views/main/index.rhtml:18:in
>> `_run_rhtml_47app47views47main47index46rhtml'
>>
>> The line in the view template it's talking about is: <%= link_to "(view
>> all)", {:controller => "products", :action => "index"}, :style =>
>>
> "float:
>
>> right;") %>
>>
>> When I remove the style hash it's fine with this line but then it
>>
> catches an
>
>> error on the very next link_to that has an html_option.
>>
>> Can someone explain why this is happening, and whether html_option is
>>
> really
>
>> incompatible with facebooker?
>>
>>
>> -a
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20090122/f9c4f675/attachment-0001.html>


More information about the Facebooker-talk mailing list