<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>ruby and rails questions - Stack Overflow</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=2KmxznVX3hGNzL7hgQSecQ</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=2KmxznVX3hGNzL7hgQSecQ&amp;_render=rss&amp;page=2"/>
      <pubDate>Thu, 01 Oct 2015 14:59:31 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>How to use Logstash cookbook</title>
         <link>http://stackoverflow.com/questions/32890723/how-to-use-logstash-cookbook</link>
         <description>&lt;p&gt;I'm trying to use &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/lusis/chef-logstash&quot;&gt;https://github.com/lusis/chef-logstash&lt;/a&gt; cookbook and running
Chef solo, my node.js looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{    
&quot;logstash&quot;: {
&quot;instance_default&quot;:{
  &quot;config_templates_cookbook&quot;: &quot;aws-logstash&quot;,
  &quot;inputs&quot;: [{&quot;file&quot;: {&quot;path&quot;:&quot;/var/log/messages&quot;,&quot;type&quot;:&quot;messages&quot;}}],
  &quot;config_templates&quot;: {&quot;myagent&quot;: &quot;agent.conf.erb&quot;}
  }},
 &quot;run_list&quot;: [&quot;recipe[logstash::agent]&quot;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The only attributes I can override are config_templates_cookbook and config_template.  I am not able to define inputs, filters or outputs via variables.  Sure defining all options under agent.conf.erb could work but it defeats the purpose of the cookbook a bit.  Can anybody help with a way to get it to work.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
         <author>user3421490</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32890723</guid>
         <pubDate>Thu, 01 Oct 2015 14:57:02 +0000</pubDate>
      </item>
      <item>
         <title>Grape API service response 400 bad request at Rails 4 when I sending a json request to it using curl</title>
         <link>http://stackoverflow.com/questions/32890467/grape-api-service-response-400-bad-request-at-rails-4-when-i-sending-a-json-requ</link>
         <description>&lt;p&gt;I don't know how to solve the 400 bad request that API service gives back to me. All I need are receiving json responses from API service, and the API service could communicate with many-type devices. &lt;p&gt;
I'm building an all-json-request API service according to tutorial of Grape gem at GitHub.com &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/ruby-grape/grape&quot;&gt;https://github.com/ruby-grape/grape&lt;/a&gt; and GitHub.io &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://intridea.github.io/grape/docs/index.html&quot;&gt;http://intridea.github.io/grape/docs/index.html&lt;/a&gt; . After I sending a json request to the API service: localhost:3000/specified_vegetables using curl, which is construct with &lt;strong&gt;Grape gem version 0.8.0&lt;/strong&gt; and located at &lt;strong&gt;new empty Rails 4.1.1 project&lt;/strong&gt;, the API service give back the response:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*   Trying ::1...
* connect to ::1 port 3000 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3000 (#0)
&amp;gt; GET /specified_vegetables/ HTTP/1.1
&amp;gt; Host: localhost:3000
&amp;gt; User-Agent: curl/7.43.0
&amp;gt; Accept: application/json
&amp;gt; Content-Type:application/json
&amp;gt; Content-Length: 55
&amp;gt;
* upload completely sent off: 55 out of 55 bytes
&amp;lt; HTTP/1.1 400 Bad Request
&amp;lt; Content-Type: application/json
&amp;lt; Content-Length: 56
&amp;lt; Cache-Control: no-cache
&amp;lt; X-Request-Id: 87231177-b8f8-4084-b0ef-19445fa42fab
&amp;lt; X-Runtime: 0.220101
&amp;lt; Server: WEBrick/1.3.1 (Ruby/2.2.1/2015-02-26)
&amp;lt; Date: Thu, 01 Oct 2015 13:35:46 GMT
&amp;lt; Connection: Keep-Alive
&amp;lt;
* Connection #0 to host localhost left intact
{&quot;error&quot;:&quot;transaction_date is missing, name is missing&quot;}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br&gt;
My curl request command: &lt;code&gt;curl -H 'Accept: application/json' -H 'Content-Type:application/json' -X GET http://localhost:3000/specified_vegetables/ -d '{&quot;transaction_date&quot; : &quot;20131031&quot;, &quot;name&quot; : &quot;金針筍&quot;}' -v&lt;/code&gt;
In my database, there is one record matched the conditions I've queried.
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
The log of rails server runs and it also includes the curl request:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;=&amp;gt; Booting WEBrick
=&amp;gt; Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=&amp;gt; Run `rails server -h` for more startup options
=&amp;gt; Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=&amp;gt; Ctrl-C to shutdown server
[2015-10-01 21:35:43] INFO  WEBrick 1.3.1
[2015-10-01 21:35:43] INFO  ruby 2.2.1 (2015-02-26) [x86_64-darwin10]
[2015-10-01 21:35:43] INFO  WEBrick::HTTPServer#start: pid=27004 port=3000


Started GET &quot;/specified_vegetables/&quot; for 127.0.0.1 at 2015-10-01 21:35:46 +0800
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br&gt;
&lt;p&gt;
The following are my environment settings and codes.&lt;br&gt;
The directory structure of API files in rails app:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;RailsApp.root/app/api/agriculture_transaction/base.rb
  RailsApp.root/app/api/agriculture_transaction/v1/specified_vegetables.rb&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;br&gt;
Code of &lt;strong&gt;base.rb&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module AgricultureTransaction
        class Base &amp;lt; Grape::API
                format :json
                version 'v1'

                mount AgricultureTransaction::V1::SpecifiedVegetables
                mount AgricultureTransaction::V1::OverviewVegetables
        end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br&gt;
Code of &lt;strong&gt;specified_vegetables.rb&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module AgricultureTransaction
       module V1
                class SpecifiedVegetables &amp;lt; Grape::API
                        format :json
                        default_format :json
                        version 'v1', using: :header, vendor: 'twitter'

                        resource :specified_vegetables do
                                desc &quot;Get all transaction prices of all items today.&quot;
                                get :today do
                                        SpecifiedVegetable.where(transaction_date: Date.today).find_in_batches do |vegetables|
                                                vegetables
                                        end
                                end

                                desc &quot;Get transaction prices of delegated item in a delegated day.&quot;
                                params do
                                        requires :transaction_date, type: Date, desc: 'code'
                                        requires :name, type: String
                                end
                                get do
                                        SpecifiedVegetable.where(transaction_date: params[:transaction_date], name: params[:name]).find_in_batches do |vegetables|
                                                vegetables
                                        end
                                end
                        end
                end
       end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br&gt;
The only one model in Rails app is &lt;strong&gt;SpecifiedVegetable.rb&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class SpecifiedVegetable &amp;lt; ActiveRecord::Base
        self.table_name = &quot;specified_vegetable&quot;
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;p&gt;
In &lt;strong&gt;config/application.rb&lt;/strong&gt; file, I add two lines in rails &lt;strong&gt;Application class&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;config.paths.add &quot;app/api&quot;, glob: &quot;**/*.rb&quot;
config.autoload_paths += Dir[&quot;#{Rails.root}/app/api/*&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;p&gt;
In &lt;strong&gt;config/routes.rb&lt;/strong&gt; file, I add one line in Rails.application.routes.draw:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mount AgricultureTransaction::Base =&amp;gt; '/'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Above of all are information I could provide. Please help me to solve this problem or give me some keywords to search. I've find some articles, but they could not help me.&lt;/p&gt;</description>
         <author>Howardsun</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32890467</guid>
         <pubDate>Thu, 01 Oct 2015 14:44:56 +0000</pubDate>
      </item>
      <item>
         <title>Erro instaling compass in OSX Yosemite</title>
         <link>http://stackoverflow.com/questions/32890346/erro-instaling-compass-in-osx-yosemite</link>
         <description>&lt;p&gt;Good day
I have a Mac with OSX Yosemite
I'm trying to install the compass with the command:&lt;/p&gt;

&lt;pre&gt;sudo gem install compass&lt;/pre&gt;

&lt;p&gt;but I am getting the following error:&lt;/p&gt;

&lt;pre&gt;
Building native extensions.  This could take a while...
ERROR:  Error installing compass:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151001-1122-1jqcu8r.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/ffi-1.9.10/gem_make.out
&lt;/pre&gt;

&lt;p&gt;before attempting to install the package I updated the gem with the command&lt;/p&gt;

&lt;pre&gt;
sudo gem update --system
&lt;/pre&gt;

&lt;p&gt;and the update occurred without errors&lt;/p&gt;</description>
         <author>DonMicillo</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32890346</guid>
         <pubDate>Thu, 01 Oct 2015 14:38:37 +0000</pubDate>
      </item>
      <item>
         <title>`for_fd': not a socket file descriptor</title>
         <link>http://stackoverflow.com/questions/32889804/for-fd-not-a-socket-file-descriptor</link>
         <description>&lt;p&gt;I've installed Redmine, it's working fine as long as I use the development server. Now I'm trying to configure it to run under apache, using fastcgi. The following message is being showed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/local/share/gems/gems/fcgi-0.9.2.1/lib/fcgi.rb:54:in `for_fd': not a socket file descriptor (ArgumentError)
        from /usr/local/share/gems/gems/fcgi-0.9.2.1/lib/fcgi.rb:54:in `default_connection'
        from /usr/local/share/gems/gems/fcgi-0.9.2.1/lib/fcgi.rb:40:in `each'
        from /usr/local/share/gems/gems/rack-1.4.7/lib/rack/handler/fastcgi.rb:27:in `run'
        from ./dispatch.fcgi:20:in `&amp;lt;main&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Looks like the problem is something related to sockets in ruby, to make it easy, I've isolated the problem:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/env ruby
require 'socket'
s=Socket.for_fd(STDIN.fileno)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When I try to run the code above, the same message is being showed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/tmp/test.rb:5:in `for_fd': not a socket file descriptor (ArgumentError)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since I'm not a ruby programmer, I would like to understand, what is happening?&lt;/p&gt;</description>
         <author>Hugo Corrá</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32889804</guid>
         <pubDate>Thu, 01 Oct 2015 14:13:31 +0000</pubDate>
      </item>
      <item>
         <title>Making a variable depend on the value of another in FactoryGirl</title>
         <link>http://stackoverflow.com/questions/32889238/making-a-variable-depend-on-the-value-of-another-in-factorygirl</link>
         <description>&lt;p&gt;I have the following problem. I have a model in which there is a validation of a variable (amount) depending on the value of another enum variable (kind).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class ScopeChange &amp;lt; ActiveRecord::Base

enum kind: [ :add, :remove, :change ]

validates :amount, :numericality =&amp;gt; { :greater_than_or_equal_to =&amp;gt; 1 } , if: &quot;self.add?&quot;
validates :amount, :numericality =&amp;gt; { :less_than_or_equal_to =&amp;gt; -1 } , if: &quot;self.remove?&quot;

end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And I want to create a Factory that builds this, I have tried putting the if statement inside the actual creator of the variable (it should be an if elsif else statment, this was just made for testing)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;FactoryGirl.define do
  factory :sprint_scope_change do
    association :sprint
    kind { Faker::Number.between(0,2) }
    amount { kind == :add ? Faker::Number.between(-7,7) }
    date { Faker::Date.between(sprint.start_date, sprint.end_date) }
    description { Faker::Lorem.sentence }
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;which didn't work, it completely ignored the if statement and just created a random number between -7 and 7. The next thing I tried was making a variable outside the factory :sprint_scope_change and inside it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;FactoryGirl.define do

  factory :sprint_scope_change do

    sprint_scope_change.kind = Faker::Number.between(0,2)

    sprint_scope_change.amount = if sprint_scope_change.kind == 0
      Faker::Number.between(1,7)
    elsif sprint_scope_change.kind == 1
      Faker::Number.between(-7,-1)
    else
      Faker::Number.between(-7,7)
    end

    association :sprint
    kind { kind }
    amount { amount }
    date { Faker::Date.between(sprint.start_date, sprint.end_date) }
    description { Faker::Lorem.sentence }
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;which worked in a way, but it gave the exact same value everytime I called the Factory. The last way that I tried was with a before(:create), but now the program just explodes and &quot;stack level is too deep&quot;, I tried to reproduce some examples that I've seen but something is definitely wrong:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;FactoryGirl.define do

factory :sprint_scope_change do
  before(:create) { |sprint_scope_change|

    sprint_scope_change.kind = Faker::Number.between(0,2)

    sprint_scope_change.amount = if sprint_scope_change.kind == 0
      Faker::Number.between(1,7)
    elsif sprint_scope_change.kind == 1
      Faker::Number.between(-7,-1)
    else
      Faker::Number.between(-7,7)
    end
  }

  association :sprint
  kind { kind }
  amount { amount }
  date { Faker::Date.between(sprint.start_date, sprint.end_date) }
  description { Faker::Lorem.sentence }

  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What can I do to achieve what I try to do? What is wrong with what I have tried so far? Any of this questions would be nice to know.&lt;/p&gt;

&lt;p&gt;(It is also worth saying that I am also new in rails and ruby)&lt;/p&gt;</description>
         <author>DJA</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32889238</guid>
         <pubDate>Thu, 01 Oct 2015 13:45:35 +0000</pubDate>
      </item>
      <item>
         <title>Rspec testing rake tasks</title>
         <link>http://stackoverflow.com/questions/32888525/rspec-testing-rake-tasks</link>
         <description>&lt;p&gt;I have a simple rake task with a &lt;code&gt;puts&lt;/code&gt; in it&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;namespace :atask
  task something: :environment do
    puts 'Foo'
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My spec is as follows&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;describe 'atask:something' do
  before { MyApp.Application.load_tasks }

  context 'one' do
    it do
      Rake::Task['atask:something'].invoke
    end
  end

  context 'two' do
    it do
      Rake::Task['atask:something'].invoke
    end
  end

  context 'three' do
    it do
      Rake::Task['atask:something'].invoke
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see it has 3 contexts and 3 it blocks. So I should see 'Foo' in the console three times, once for each time the task is invoked. However, I only see 'Foo' once in the console even though it is invoked three times.&lt;/p&gt;</description>
         <author>Carl Markham</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32888525</guid>
         <pubDate>Thu, 01 Oct 2015 13:13:13 +0000</pubDate>
      </item>
      <item>
         <title>mongoid_search and frequency of updates</title>
         <link>http://stackoverflow.com/questions/32888315/mongoid-search-and-frequency-of-updates</link>
         <description>&lt;p&gt;The mongoid_search gem needs to index records to work properly. It does this with a rake task...but this needs to be run each record destroy or create to really work well. Is this a good idea to use? Should I just run that rake task after each destroy/create for each model? &lt;/p&gt;

&lt;p&gt;Can someone help me understand what's best practice? Should this be a cron task? &lt;/p&gt;</description>
         <author>Kevin Brown</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32888315</guid>
         <pubDate>Thu, 01 Oct 2015 13:04:14 +0000</pubDate>
      </item>
      <item>
         <title>Avoiding basic auth with Selenium (using Ruby)</title>
         <link>http://stackoverflow.com/questions/32888292/avoiding-basic-auth-with-selenium-using-ruby</link>
         <description>&lt;p&gt;Well, the code is basically&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;d = Selenium::WebDriver.for :firefox, :profile =&amp;gt; &quot;myApp&quot;
d.get(&quot;http://login:password@myapp.local&quot;)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And still firefox shows basic auth dialog window. I use the profile setting for FF so it hopefully remembers it and lets me through, but in reality it just remembers it and you still have to hit enter.&lt;/p&gt;

&lt;p&gt;Kinda out of ideas here.&lt;/p&gt;

&lt;p&gt;P.S. Yes, i double checked that login:password are totally correct.&lt;/p&gt;</description>
         <author>user2808225</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32888292</guid>
         <pubDate>Thu, 01 Oct 2015 13:02:50 +0000</pubDate>
      </item>
      <item>
         <title>How to show field from a table that connects another table?</title>
         <link>http://stackoverflow.com/questions/32888251/how-to-show-field-from-a-table-that-connects-another-table</link>
         <description>&lt;p&gt;I have a Project model that can contain many Products through the model Benefit (and vice versa for the Product model). Within the Benefits tabel a project_id and product_id are uniquely indexed.&lt;/p&gt;

&lt;p&gt;I've created the Benefit model to be able to add a product to multiple projects and I want to add extra data through every benefit (benefit.title etc.).&lt;/p&gt;

&lt;p&gt;I'm able to show the products per project, but I'm not able to show any other benefit.value.&lt;/p&gt;

&lt;p&gt;My Project model is connected to Benefits like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;has_many :benefits
has_many :products, through: :benefits
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In my Project view (show.html.erb) I'm showing my product field like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;% @products.each do |product| %&amp;gt;
                    &amp;lt;%= link_to [product.project, product] do %&amp;gt;    
                        &amp;lt;div class=&quot;row&quot;&amp;gt;
                                &amp;lt;div class=&quot;col m3&quot;&amp;gt;
                                    &amp;lt;img height=&quot;20&quot; src=&quot;&amp;lt;%= product.image %&amp;gt;&quot;&amp;gt;&amp;lt;/img&amp;gt;
                                &amp;lt;/div&amp;gt;
                                &amp;lt;div class=&quot;col m3&quot;&amp;gt;
                                    &amp;lt;%= product.name %&amp;gt;
                                &amp;lt;/div&amp;gt;
                                &amp;lt;div class=&quot;col m3 truncate&quot;&amp;gt;
                                    &amp;lt;%= product.content %&amp;gt;
                                &amp;lt;/div&amp;gt;                                  
                                &amp;lt;div class=&quot;col m3&quot;&amp;gt;
                                    &amp;lt;i class=&quot;tiny red-text material-icons right&quot;&amp;gt;favorite_border&amp;lt;/i&amp;gt;
                                &amp;lt;/div&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;% end %&amp;gt;
                &amp;lt;% end %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But it tells me that I'm using an undefined local variable or method 'Benefit', when I try to add the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;% @products.each do |product| %&amp;gt;
                    &amp;lt;%= link_to [product.project, product] do %&amp;gt;    
                        &amp;lt;div class=&quot;row&quot;&amp;gt;
                                &amp;lt;div class=&quot;col m3&quot;&amp;gt;
                                    &amp;lt;img height=&quot;20&quot; src=&quot;&amp;lt;%= product.image %&amp;gt;&quot;&amp;gt;&amp;lt;/img&amp;gt;
                                &amp;lt;/div&amp;gt;
                                &amp;lt;div class=&quot;col m3&quot;&amp;gt;
                                    &amp;lt;%= product.name %&amp;gt;
                                &amp;lt;/div&amp;gt;
                                &amp;lt;div class=&quot;col m3 truncate&quot;&amp;gt;
                                    &amp;lt;%= benefit.title %&amp;gt;
                                &amp;lt;/div&amp;gt;                                  
                                &amp;lt;div class=&quot;col m3&quot;&amp;gt;
                                    &amp;lt;i class=&quot;tiny red-text material-icons right&quot;&amp;gt;favorite_border&amp;lt;/i&amp;gt;
                                &amp;lt;/div&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;% end %&amp;gt;
                &amp;lt;% end %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Any ideas on how I should handle this?&lt;/p&gt;

&lt;p&gt;I'm using Ruby-on-Rails 4.2.0 and I'm a novice (as you can clearly see ;) )&lt;/p&gt;</description>
         <author>Sebastian Plasschaert</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32888251</guid>
         <pubDate>Thu, 01 Oct 2015 13:01:14 +0000</pubDate>
      </item>
      <item>
         <title>How to properly use lookahead in Ruby Regex?</title>
         <link>http://stackoverflow.com/questions/32887658/how-to-properly-use-lookahead-in-ruby-regex</link>
         <description>&lt;p&gt;I am expecting this to match only the first instance of &lt;code&gt;&amp;lt;style&lt;/code&gt;, because the second one, after the space has the pattern that I have put in the negative lookahead.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&quot;&amp;lt;style type=&amp;#92;&quot;text/html&amp;#92;&quot;&amp;gt;ciaoxocs &amp;lt;style /&amp;gt;&quot;.scan /&amp;lt;style&amp;#92;s?(?!&amp;#92;/&amp;gt;)/
# =&amp;gt; [&quot;&amp;lt;style &quot;, &quot;&amp;lt;style&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I want to an explanation for what is happening here, and possibly a better solution to match only the first instance without matching the closing tag with or without space:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;style /&amp;gt; or &amp;lt;style/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In regex101.com, it works as expected with other langs:&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.regex101.com/r/pW2oM3/1&quot;&gt;https://www.regex101.com/r/pW2oM3/1&lt;/a&gt;&lt;/p&gt;</description>
         <author>ciaoben</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32887658</guid>
         <pubDate>Thu, 01 Oct 2015 12:30:14 +0000</pubDate>
      </item>
      <item>
         <title>Ruby: generating controller in rails won't gets error</title>
         <link>http://stackoverflow.com/questions/32887255/ruby-generating-controller-in-rails-wont-gets-error</link>
         <description>&lt;p&gt;I recently installed ruby and the rails dev kit in order to fiddle about on the web server stuff for some project I'm working on&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;C:&amp;#92;Users&amp;#92;User&amp;#92;Test&amp;gt;rails generate controller New
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x64-mingw32/lib/sqlite3.rb:6:in `rescue in &amp;lt;top (required)&amp;gt;'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x64-mingw32/lib/sqlite3.rb:2:in `&amp;lt;top (required)&amp;gt;'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from C:/Users/User/Test/config/application.rb:7:in `&amp;lt;top (required)&amp;gt;'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:141:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:50:in `generate'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `&amp;lt;top (required)&amp;gt;'
    from bin/rails:4:in `require'
    from bin/rails:4:in `&amp;lt;main&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What does this error mean and how do i fix it? thanks in advance!&lt;/p&gt;</description>
         <author>Will Sherwood</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32887255</guid>
         <pubDate>Thu, 01 Oct 2015 12:08:24 +0000</pubDate>
      </item>
      <item>
         <title>Do we have a Python or Ruby equivallent of assign variable with contents of another variable that will change dynamicall as in PHP? [duplicate]</title>
         <link>http://stackoverflow.com/questions/32887173/do-we-have-a-python-or-ruby-equivallent-of-assign-variable-with-contents-of-anot</link>
         <description>&lt;div class=&quot;question-status question-originals-of-duplicate&quot;&gt;
    &lt;p&gt;This question already has an answer here:&lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;
            &lt;a rel=&quot;nofollow&quot; dir=&quot;ltr&quot;&gt;How do I pass a variable by reference?&lt;/a&gt;
                &lt;span class=&quot;question-originals-answer-count&quot;&gt;
                    16 answers
                &lt;/span&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;

            &lt;p&gt;Recently I came across a PHP program that use &quot;= &amp;amp;&quot; assign variable value with reference to another variable as in below example.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$var1 = 'val-A';    #Assign any value to variable $var1
$var2 = &amp;amp;$var1;     #Assign value of variable $var1 to variable $var2 by reference &quot;= &amp;amp;&quot;
$var3 = $var1;      #Assign value of variable $var1 to variable $var3 as usual

$var1 = 'val-X';    #Change value assigned to variable $var1

echo '$var1 = ' .$var1; #printed the changed value &quot;val-X&quot;
echo '$var2 = ' .$var2; #printed the changed value &quot;val-X&quot; not sure if this can be accomplished in Python or Ruby.
echo '$var3 = ' .$var3; #printed the unchanged value &quot;val-A&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&quot;$var2 = &amp;amp;$var1&quot; Can this be accomplished in Python or Ruby ? or is there a equivalent that will accomplish this ?&lt;/p&gt;</description>
         <author>Sumanogeek</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32887173</guid>
         <pubDate>Thu, 01 Oct 2015 12:04:04 +0000</pubDate>
      </item>
      <item>
         <title>Combine multiple lines into single line</title>
         <link>http://stackoverflow.com/questions/32886988/combine-multiple-lines-into-single-line</link>
         <description>&lt;p&gt;My file is mentioned below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[Suresh
asdfala
adsfafa
sdfasdfa
asdfas
asdfasdfasd
[Sala
sdfadsf
adsfasd
asdfa
wewet
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Based on the delimiter &lt;code&gt;&quot;[&quot;&lt;/code&gt;, I want to separate the lines. I want an output like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[Suresh asdfala adsfafa sdfasdfa asdfas asdfasdfasd

[Sala sdfadsf adsfasd asdfa wewet
&lt;/code&gt;&lt;/pre&gt;</description>
         <author>user60679</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32886988</guid>
         <pubDate>Thu, 01 Oct 2015 11:54:30 +0000</pubDate>
      </item>
      <item>
         <title>Pubnub publish not publishing</title>
         <link>http://stackoverflow.com/questions/32886003/pubnub-publish-not-publishing</link>
         <description>&lt;p&gt;I am trying to publish a message to pubnub channel but its not publishing on server. However its working absolutely fine on local machine. Any idea where I am doing it wrong?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Message &amp;lt; ActiveRecord::Base

  after_create :send_message_to_driver

  def send_message_to_ABC
    $pubnub.publish(
        channel: &quot;chat_ABC&quot;,
        message: message
    ) do |env|
      puts env.parsed_response
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;$pubnub is being initialized globally for app.&lt;/p&gt;</description>
         <author>Adnan Ali</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32886003</guid>
         <pubDate>Thu, 01 Oct 2015 11:04:52 +0000</pubDate>
      </item>
      <item>
         <title>Backend refinerycms doesn't work in production environment</title>
         <link>http://stackoverflow.com/questions/32885036/backend-refinerycms-doesnt-work-in-production-environment</link>
         <description>&lt;p&gt;When I try use rails server -e production, does't work backend  (localhost:3000/refiner), just see &quot;We're sorry, but something went wrong.&quot;
&quot;If you are the application owner check the logs for more information.&quot;&lt;/p&gt;

&lt;p&gt;Full log with error &quot;Not Enough Stack Space&quot;&lt;/p&gt;

&lt;pre&gt;
    I, [2015-10-01T11:47:03.272986 #11996]  INFO -- : Started GET &quot;/refinery&quot; for ::1 at 2015-10-01 11:47:03 +0200
    I, [2015-10-01T11:47:03.919433 #11996]  INFO -- : Processing by Refinery::Admin::CoreController#index as HTML
    I, [2015-10-01T11:47:03.919433 #11996]  INFO -- :   Parameters: {&quot;locale&quot;=&amp;gt;:en}
    I, [2015-10-01T11:47:03.934460 #11996]  INFO -- : Redirected to http://localhost:3000/refinery/login
    I, [2015-10-01T11:47:03.934460 #11996]  INFO -- : Filter chain halted as :authenticate_refinery_user! rendered or redirected
    I, [2015-10-01T11:47:03.935443 #11996]  INFO -- : Completed 302 Found in 16ms (ActiveRecord: 0.0ms)
    I, [2015-10-01T11:47:03.948784 #11996]  INFO -- : Started GET &quot;/refinery/login&quot; for ::1 at 2015-10-01 11:47:03 +0200
    I, [2015-10-01T11:47:03.950182 #11996]  INFO -- : Processing by Refinery::Authentication::Devise::SessionsController#new as HTML
    I, [2015-10-01T11:47:03.951182 #11996]  INFO -- :   Parameters: {&quot;locale&quot;=&amp;gt;:en}
    D, [2015-10-01T11:47:03.966212 #11996] DEBUG -- :   [1m[36mRefinery::Authentication::Devise::Role Load (1.0ms)[0m  [1mSELECT  &quot;refinery_authentication_devise_roles&quot;.* FROM &quot;refinery_authentication_devise_roles&quot; WHERE &quot;refinery_authentication_devise_roles&quot;.&quot;title&quot; = $1  ORDER BY &quot;refinery_authentication_devise_roles&quot;.&quot;id&quot; ASC LIMIT 1[0m  [[&quot;title&quot;, &quot;Refinery&quot;]]
    D, [2015-10-01T11:47:04.026238 #11996] DEBUG -- :   [1m[35mRefinery::Authentication::Devise::User Exists (1.0ms)[0m  SELECT  1 AS one FROM &quot;refinery_authentication_devise_users&quot; INNER JOIN &quot;refinery_authentication_devise_roles_users&quot; ON &quot;refinery_authentication_devise_users&quot;.&quot;id&quot; = &quot;refinery_authentication_devise_roles_users&quot;.&quot;user_id&quot; WHERE &quot;refinery_authentication_devise_roles_users&quot;.&quot;role_id&quot; = $1 LIMIT 1  [[&quot;role_id&quot;, 1]]
    I, [2015-10-01T11:47:04.027255 #11996]  INFO -- : Redirected to http://localhost:3000/refinery/users/register
    I, [2015-10-01T11:47:04.027255 #11996]  INFO -- : Filter chain halted as :force_signup_when_no_users! rendered or redirected
    I, [2015-10-01T11:47:04.027255 #11996]  INFO -- : Completed 302 Found in 76ms (ActiveRecord: 7.0ms)
    I, [2015-10-01T11:47:04.041322 #11996]  INFO -- : Started GET &quot;/refinery/users/register&quot; for ::1 at 2015-10-01 11:47:04 +0200
    I, [2015-10-01T11:47:04.043321 #11996]  INFO -- : Processing by Refinery::Authentication::Devise::UsersController#new as HTML
    I, [2015-10-01T11:47:04.043321 #11996]  INFO -- :   Parameters: {&quot;locale&quot;=&amp;gt;:en}
    D, [2015-10-01T11:47:04.045321 #11996] DEBUG -- :   [1m[36mRefinery::Authentication::Devise::Role Load (0.0ms)[0m  [1mSELECT  &quot;refinery_authentication_devise_roles&quot;.* FROM &quot;refinery_authentication_devise_roles&quot; WHERE &quot;refinery_authentication_devise_roles&quot;.&quot;title&quot; = $1  ORDER BY &quot;refinery_authentication_devise_roles&quot;.&quot;id&quot; ASC LIMIT 1[0m  [[&quot;title&quot;, &quot;Refinery&quot;]]
    D, [2015-10-01T11:47:04.047341 #11996] DEBUG -- :   [1m[35mRefinery::Authentication::Devise::User Exists (1.0ms)[0m  SELECT  1 AS one FROM &quot;refinery_authentication_devise_users&quot; INNER JOIN &quot;refinery_authentication_devise_roles_users&quot; ON &quot;refinery_authentication_devise_users&quot;.&quot;id&quot; = &quot;refinery_authentication_devise_roles_users&quot;.&quot;user_id&quot; WHERE &quot;refinery_authentication_devise_roles_users&quot;.&quot;role_id&quot; = $1 LIMIT 1  [[&quot;role_id&quot;, 1]]
    I, [2015-10-01T11:47:04.066336 #11996]  INFO -- :   Rendered C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_error_messages.html.erb (1.0ms)
    I, [2015-10-01T11:47:04.077363 #11996]  INFO -- :   Rendered C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_form_actions.html.erb (2.0ms)
    I, [2015-10-01T11:47:04.077363 #11996]  INFO -- :   Rendered C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/refinerycms-authentication-devise-1.0.4/app/views/refinery/authentication/devise/users/new.html.erb within refinery/layouts/login (19.0ms)
    I, [2015-10-01T11:47:04.085350 #11996]  INFO -- :   Rendered C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/_html_tag.html.erb (0.0ms)
    I, [2015-10-01T11:47:13.100227 #11996]  INFO -- :   Rendered C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_javascripts.html.erb (8784.7ms)
    I, [2015-10-01T11:47:13.100227 #11996]  INFO -- :   Rendered C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_head.html.erb (9007.9ms)
    I, [2015-10-01T11:47:13.101210 #11996]  INFO -- : Completed 500 Internal Server Error in 9058ms (ActiveRecord: 1.0ms)
    F, [2015-10-01T11:47:13.104230 #11996] FATAL -- : 

&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ActionView::Template::Error (Error: Not Enough Stack Space):
3:   refinery.current_admin_locale = '%= current_admin_locale %&amp;gt;';
4: &amp;lt;/script&amp;gt;
5: &amp;lt;%= javascript_include_tag 'admin' -%&amp;gt;
6: &amp;lt;%= javascript_include_tag 'refinery/refinery' -%&amp;gt;
7: &amp;lt;%= javascript_include_tag 'refinery/application' -%&amp;gt;
8: &amp;lt;% visual_editor_javascripts.each do |js| %&amp;gt;
9: &amp;lt;%= javascript_include_tag js %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;
  execjs (2.6.0) lib/execjs/external_runtime.rb:39:in `exec'
  execjs (2.6.0) lib/execjs/external_runtime.rb:21:in `eval'
  execjs (2.6.0) lib/execjs/external_runtime.rb:46:in `call'
  uglifier (2.7.2) lib/uglifier.rb:212:in `run_uglifyjs'
  uglifier (2.7.2) lib/uglifier.rb:179:in `compile'
  sprockets (3.3.5) lib/sprockets/uglifier_compressor.rb:52:in `call'
  sprockets (3.3.5) lib/sprockets/uglifier_compressor.rb:28:in `call'
  sprockets (3.3.5) lib/sprockets/processor_utils.rb:75:in `call_processor'
  sprockets (3.3.5) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
  sprockets (3.3.5) lib/sprockets/processor_utils.rb:56:in `reverse_each'
  sprockets (3.3.5) lib/sprockets/processor_utils.rb:56:in `call_processors'
  sprockets (3.3.5) lib/sprockets/loader.rb:134:in `load_from_unloaded'
  sprockets (3.3.5) lib/sprockets/loader.rb:60:in `block in load'
  sprockets (3.3.5) lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
  sprockets (3.3.5) lib/sprockets/loader.rb:44:in `load'
  sprockets (3.3.5) lib/sprockets/cached_environment.rb:20:in `block in initialize'
  sprockets (3.3.5) lib/sprockets/cached_environment.rb:47:in `yield'
  sprockets (3.3.5) lib/sprockets/cached_environment.rb:47:in `load'
  sprockets (3.3.5) lib/sprockets/base.rb:66:in `find_asset'
  sprockets (3.3.5) lib/sprockets/base.rb:92:in `[]'
  sprockets-rails (2.3.3) lib/sprockets/rails/helper.rb:123:in `asset_digest_path'
  sprockets-rails (2.3.3) lib/sprockets/rails/helper.rb:76:in `compute_asset_path'
  actionview (4.2.4) lib/action_view/helpers/asset_url_helper.rb:135:in `asset_path'
  sprockets-rails (2.3.3) lib/sprockets/rails/helper.rb:91:in `asset_path'
  actionview (4.2.4) lib/action_view/helpers/asset_url_helper.rb:245:in `javascript_path'
  actionview (4.2.4) lib/action_view/helpers/asset_tag_helper.rb:61:in `block in javascript_include_tag'
  actionview (4.2.4) lib/action_view/helpers/asset_tag_helper.rb:59:in `map'
  actionview (4.2.4) lib/action_view/helpers/asset_tag_helper.rb:59:in `javascript_include_tag'
  sprockets-rails (2.3.3) lib/sprockets/rails/helper.rb:148:in `javascript_include_tag'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_javascripts.html.erb:6:in `block in _____ails_nstaller__uby______lib_ruby_gems_______bundler_gems_refinerycms______eb____a_core_app_views_refinery_admin__javascripts_html_erb__699626600_45364524'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_javascripts.html.erb:5:in `each'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_javascripts.html.erb:5:in `_____ails_nstaller__uby______lib_ruby_gems_______bundler_gems_refinerycms______eb____a_core_app_views_refinery_admin__javascripts_html_erb__699626600_45364524'
  actionview (4.2.4) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.2.4) lib/active_support/notifications.rb:166:in `instrument'
  actionview (4.2.4) lib/action_view/template.rb:333:in `instrument'
  actionview (4.2.4) lib/action_view/template.rb:143:in `render'
  actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
  actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
  actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
  actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
  actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:309:in `render'
  actionview (4.2.4) lib/action_view/renderer/renderer.rb:47:in `render_partial'
  actionview (4.2.4) lib/action_view/helpers/rendering_helper.rb:35:in `render'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/core/app/views/refinery/admin/_head.html.erb:15:in `_____ails_nstaller__uby______lib_ruby_gems_______bundler_gems_refinerycms______eb____a_core_app_views_refinery_admin__head_html_erb__397849273_78430692'
  actionview (4.2.4) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.2.4) lib/active_support/notifications.rb:166:in `instrument'
  actionview (4.2.4) lib/action_view/template.rb:333:in `instrument'
  actionview (4.2.4) lib/action_view/template.rb:143:in `render'
  actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
  actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
  actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
  actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
  actionview (4.2.4) lib/action_view/renderer/partial_renderer.rb:309:in `render'
  actionview (4.2.4) lib/action_view/renderer/renderer.rb:47:in `render_partial'
  actionview (4.2.4) lib/action_view/helpers/rendering_helper.rb:35:in `render'
  refinerycms-authentication-devise (1.0.4) app/views/refinery/layouts/login.html.erb:3:in `_____ails_nstaller__uby______lib_ruby_gems_______gems_refinerycms_authentication_devise_______app_views_refinery_layouts_login_html_erb__978516324_77536596'
  actionview (4.2.4) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.2.4) lib/active_support/notifications.rb:166:in `instrument'
  actionview (4.2.4) lib/action_view/template.rb:333:in `instrument'
  actionview (4.2.4) lib/action_view/template.rb:143:in `render'
  actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
  actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
  actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:14:in `render'
  actionview (4.2.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionview (4.2.4) lib/action_view/renderer/renderer.rb:23:in `render'
  actionview (4.2.4) lib/action_view/rendering.rb:100:in `_render_template'
  actionpack (4.2.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
  actionview (4.2.4) lib/action_view/rendering.rb:83:in `render_to_body'
  actionpack (4.2.4) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
  actionpack (4.2.4) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
  actionpack (4.2.4) lib/abstract_controller/rendering.rb:25:in `render'
  actionpack (4.2.4) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
  activesupport (4.2.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
  activesupport (4.2.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
  activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:43:in `render'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/refinerycms-39768eb0534a/pages/lib/refinery/pages/instance_methods.rb:21:in `render'
  actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
  actionpack (4.2.4) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
  activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
  activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
  activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.4) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.4) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.2.4) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.4) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `call'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:45:in `serve'
  actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:49:in `serve'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
  railties (4.2.4) lib/rails/engine.rb:518:in `call'
  railties (4.2.4) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.4) lib/rails/railtie.rb:194:in `method_missing'
  actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
  dragonfly (1.0.12) lib/dragonfly/middleware.rb:14:in `call'
  dragonfly (1.0.12) lib/dragonfly/middleware.rb:14:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.6.4) lib/rack/etag.rb:24:in `call'
  rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
  rack (1.6.4) lib/rack/head.rb:13:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
  rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
  activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  dragonfly (1.0.12) lib/dragonfly/cookie_monster.rb:9:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.4) lib/rails/engine.rb:518:in `call'
  railties (4.2.4) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
&lt;/pre&gt;

&lt;p&gt;I have installed refinerycms 3.0.0 on windows&lt;/p&gt;</description>
         <author>Ardron</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32885036</guid>
         <pubDate>Thu, 01 Oct 2015 10:16:33 +0000</pubDate>
      </item>
      <item>
         <title>Conditionals in ruby</title>
         <link>http://stackoverflow.com/questions/32884176/conditionals-in-ruby</link>
         <description>&lt;p&gt;I want to create conditions.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Find the sum of all the multiples of 3 or 5 below 1000.
sum = 0
for i in 0..1000 do
  if i % 3 == 0
    sum += i
  end
  elsif i % 5 == 0
    sum += i
  end
  else next
  end
end
puts sum
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I receive a syntax error. I will appreciate any form of help. I do not know what I did wrong.&lt;/p&gt;</description>
         <author>Charllie</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32884176</guid>
         <pubDate>Thu, 01 Oct 2015 09:35:17 +0000</pubDate>
      </item>
      <item>
         <title>Ruby libXML Xpath find returns result in result</title>
         <link>http://stackoverflow.com/questions/32883570/ruby-libxml-xpath-find-returns-result-in-result</link>
         <description>&lt;p&gt;Parsing a XML document with Ruby libXML i noticed a strange behaviour.
When searching for some elements and traversing the result, I get the result object back in the result itself.&lt;/p&gt;

&lt;p&gt;Here's an example XML&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;main&amp;gt;
    &amp;lt;projects&amp;gt;
        &amp;lt;project id=&quot;1&quot;&amp;gt;
            &amp;lt;name&amp;gt;Project 1&amp;lt;/name&amp;gt;
            &amp;lt;van&amp;gt;Guus&amp;lt;/van&amp;gt;
        &amp;lt;/project&amp;gt;
        &amp;lt;project id=&quot;2&quot;&amp;gt;
            &amp;lt;name&amp;gt;Project 2&amp;lt;/name&amp;gt;
            &amp;lt;van&amp;gt;Guus&amp;lt;/van&amp;gt;
        &amp;lt;/project&amp;gt;
    &amp;lt;/projects&amp;gt;
&amp;lt;/main&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Parsing the code (controller):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; @projects = @xmlDoc.find('//project[@id]/name')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Displaying it (view):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
&amp;lt;%= @projects.each do |pr| %&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;%= pr.first.content %&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;% end %&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;hr&amp;gt;
&amp;lt;%= @projects.inspect%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Results in:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- Project 1
- Project 2
  #&amp;lt;LibXML::XML::XPath::Object:0x000008153182c0&amp;gt;  
------------------------------------------------------------------------
#&amp;lt;LibXML::XML::XPath::Object:0x000008153182c0&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, the list contains the XPath object self.
I intentionally displayed it as a bullet list and an inspect after a horizontal line.
As you can see, the last item does not have a bullet in front of it.
But where does it come from?
Am I missing something or is this a bug?&lt;/p&gt;</description>
         <author>GTeley</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32883570</guid>
         <pubDate>Thu, 01 Oct 2015 09:06:06 +0000</pubDate>
      </item>
      <item>
         <title>How do I find Capybara::Node::Element that corresponds to Selenium::WebDriver::Element</title>
         <link>http://stackoverflow.com/questions/32883484/how-do-i-find-capybaranodeelement-that-corresponds-to-seleniumwebdrivere</link>
         <description>&lt;p&gt;There is a node, that I find by coordinates and wish to execute a relative xpath query on it, so I probably need a Capybara object (&lt;code&gt;Capybara::Node::Element&lt;/code&gt;) for &lt;code&gt;.find(:xpath&lt;/code&gt;, but the object I get from &lt;code&gt;evaluate_script(&quot;document.elementFromPoint&lt;/code&gt; is a Selenium object (&lt;code&gt;Selenium::WebDriver::Element&lt;/code&gt;).&lt;/p&gt;</description>
         <author>Nakilon</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32883484</guid>
         <pubDate>Thu, 01 Oct 2015 09:02:16 +0000</pubDate>
      </item>
      <item>
         <title>Rails uninitialized constant error in controller</title>
         <link>http://stackoverflow.com/questions/32879298/rails-uninitialized-constant-error-in-controller</link>
         <description>&lt;p&gt;Here is my controller directory structure&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;controllers/
.........../dashboard
...................../admin
.........................../admin_controller.rb
.........................../item_controller.rb
........../items_controller.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I expect that manager can add new item, and users can see all items.&lt;/p&gt;

&lt;p&gt;I typed &lt;code&gt;rails g scaffold dashboard/admin/items&lt;/code&gt; to quickly generate controller with namespace.&lt;/p&gt;

&lt;p&gt;And I modified &lt;code&gt;@dashboard_admin_items = Dashboard::Admin::Item.all&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;to &lt;code&gt;@dashboard_admin_items = Item.all&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;controllers/dashboard/admin/items_controller.rb&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Dashboard::Admin::ItemsController &amp;lt; Dashboard::Admin::AdminController
  before_action :set_dashboard_admin_item, only: [:show, :edit, :update, :destroy]

  # GET /dashboard/admin/items
  def index
    @dashboard_admin_items = Item.all

  end
...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But it threw this error 
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://i.stack.imgur.com/wy14V.png&quot;&gt;&lt;img src=&quot;http://i.stack.imgur.com/wy14V.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, I've put this project on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/fifiteen82726/ShopCart&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Update&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;view/dashboard/admin/items/index.html.erb&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;tbody&amp;gt;
    &amp;lt;% @Items.each do |i| %&amp;gt;
      &amp;lt;tr&amp;gt;
        &amp;lt;th&amp;gt;&amp;lt;%= i.id %&amp;gt;&amp;lt;/th&amp;gt;
        &amp;lt;th&amp;gt;&amp;lt;%= i.name %&amp;gt;&amp;lt;/th&amp;gt;
        &amp;lt;th&amp;gt;&amp;lt;%= i.price %&amp;gt;&amp;lt;/th&amp;gt;
        &amp;lt;!-- &amp;lt;td&amp;gt;&amp;lt;%#= link_to 'Show', dashboard_admin_item %&amp;gt;&amp;lt;/td&amp;gt; --&amp;gt;
        &amp;lt;td&amp;gt;
          &amp;lt;%= link_to 'Edit', edit_dashboard_admin_item_path(dashboard_admin_item) %&amp;gt;
          &amp;lt;%= link_to 'Destroy', dashboard_admin_item, method: :delete, data: { confirm: 'Are you sure?' } %&amp;gt;
        &amp;lt;/td&amp;gt;
      &amp;lt;/tr&amp;gt;
    &amp;lt;% end %&amp;gt;
  &amp;lt;/tbody&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;controllers/dashboard/admin/items_controller.rb&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def index
    @Items = Item.all
end
&lt;/code&gt;&lt;/pre&gt;</description>
         <author>Coda Chang</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32879298</guid>
         <pubDate>Thu, 01 Oct 2015 04:09:31 +0000</pubDate>
      </item>
      <item>
         <title>How to refresh the database connection</title>
         <link>http://stackoverflow.com/questions/32878816/how-to-refresh-the-database-connection</link>
         <description>&lt;p&gt;I inserted a column in mysql using my terminal then in rails I tried to get the columns,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;puts (Class.new(ActiveRecord::Base) { self.table_name = 'sample_tables'}).column_names
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;but it will not show the inserted column. I need to refresh my rails first to show it. What code do I need to add to refresh the connection before getting the columns?&lt;/p&gt;

&lt;p&gt;I tested it using &lt;code&gt;rails c&lt;/code&gt;. Thanks in advance for the help.&lt;/p&gt;

&lt;p&gt;BTW, I tried this &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(Class.new(ActiveRecord::Base) { self.table_name = 'sample_tables'}).reload
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;but it's not working.&lt;/p&gt;</description>
         <author>do_Ob</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32878816</guid>
         <pubDate>Thu, 01 Oct 2015 03:06:40 +0000</pubDate>
      </item>
      <item>
         <title>Rails Nested Resource not creating from Array</title>
         <link>http://stackoverflow.com/questions/32877958/rails-nested-resource-not-creating-from-array</link>
         <description>&lt;p&gt;I am trying to create a simple data puller from the yahoo finance gem. I have a nested route setup for Security that has_many Price&lt;/p&gt;

&lt;p&gt;The Price controller is as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class PricesController &amp;lt; ApplicationController
  before_action :set_security
  before_action :set_price, only: [:show, :edit, :update, :destroy]

  def new
    @price = Price.new
  end

  private
  def set_price
    @price = Price.find_by_name(params[:id])
  end

  def price_params
    params.require(:price).permit(:date, :open, :high, :low, :close, :volume, :security_id)
  end

  def set_security
    @security = Security.find_by_ticker(params[:security_id])
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The nested route works fine to manually create the child Price record from a form. I'm trying to create a Price record for each result in the array that gets generated from the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Datapuller

  def self.download_historical
    yahoo_client = YahooFinance::Client.new
    data = yahoo_client.historical_quotes(&quot;FB&quot;)

    data.each do |i|
      @ticker = Security.find_by_ticker(data[0].symbol )
      price = @ticker.prices.new()
      price.security_id = @ticker
      price.date = data[0].date
      price.open = data[0].open
      price.high = data[0].high
      price.low = data[0].low
      price.close = data[0].close
     end
   end
 end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I'd like to call this method from a button link but for now I have the following code on the Security View:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;%= Datapuller.download_historical %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This also give me the benefit to see the data that is getting loaded from the array.&lt;/p&gt;

&lt;p&gt;With the above code I can create a child Price to a parent Security using a form and I can make the call from the yahoo finance gem. However, the array is not creating a Price record for each line in the array. &lt;/p&gt;

&lt;p&gt;What am I missing in this?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
         <author>M. Wood</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32877958</guid>
         <pubDate>Thu, 01 Oct 2015 01:08:25 +0000</pubDate>
      </item>
      <item>
         <title>How does capybara/selenium grab current URL? Issue with single page site</title>
         <link>http://stackoverflow.com/questions/32870660/how-does-capybara-selenium-grab-current-url-issue-with-single-page-site</link>
         <description>&lt;p&gt;I am using ruby and capybara(which leverages selenium) to automate walking through a website. After navigating to a new page I verify that the new page URL is what i'm expecting. My issue comes when I walk through an order funnel that is a single page but loads different views.&lt;/p&gt;

&lt;p&gt;Some code...&lt;/p&gt;

&lt;p&gt;I create my session instance then have additional code opening the browser and walking to a certain point in the website that I wont include&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$session = Capybara::Session.new(:selenium)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My line for checking the browser URL without search params ie: everything after '?'&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if url == $session.current_url.to_s.split(&quot;?&quot;)[0]
        urlCorrect = true
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This code works fine when my URL is &lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.homepage.com&quot;&gt;https://www.homepage.com&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Then I click on a link that takes me to my order funnel ... &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.homepage.com/order#/orderpage1?option1=something&amp;amp;option2=somethingelse&quot;&gt;https://www.homepage.com/order#/orderpage1?option1=something&amp;amp;option2=somethingelse&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;My function still matches the expected URL. But the issue comes when I move to the second page of the order funnel : &lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.homepage.com/order#/orderpage2?option1=something&amp;amp;option2=somethingelse&quot;&gt;https://www.homepage.com/order#/orderpage2?option1=something&amp;amp;option2=somethingelse&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;My capybara code to get current url still returns the URL from orderpage1. Im guessing its because there is no postback when moving from orderpage1 to orderpage2 but i dont know how to force a postback or tell capybara to re-grab the url&lt;/p&gt;

&lt;p&gt;Any advice will be appreciated.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Quick Edit: I forgot to mention this behavior is only in IE. Chrome and Firefox both work correctly with the exact same code&lt;/p&gt;</description>
         <author>Trivial</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32870660</guid>
         <pubDate>Wed, 30 Sep 2015 15:58:18 +0000</pubDate>
      </item>
      <item>
         <title>Will paginate rails limit num of pages to max 10?</title>
         <link>http://stackoverflow.com/questions/32867126/will-paginate-rails-limit-num-of-pages-to-max-10</link>
         <description>&lt;p&gt;I am using will paginate for pagination. I have total 11 pages currently. At footer it shows all the 11 pages no matter on what page the user is. How can I display max 10 pages at footer. So if user comes on page no 5 it will show 5 pages before and after. Not all at once.&lt;/p&gt;</description>
         <author>Sumeet</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32867126</guid>
         <pubDate>Wed, 30 Sep 2015 13:14:55 +0000</pubDate>
      </item>
      <item>
         <title>Rails nested group and count with column renaming</title>
         <link>http://stackoverflow.com/questions/32861858/rails-nested-group-and-count-with-column-renaming</link>
         <description>&lt;p&gt;I have a model which looks this way:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Issue(id, ..., tracker_id)
                   |
          Tracker(id, ..., name)
&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;pre&gt;&lt;code&gt;Issue has_one :tracker
Tracker has_many :issues
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And I would like to get the number of Issues per Tracker. What I have got is:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Issue.group(:tracker_id).count =&amp;gt; {3=&amp;gt;446, 5=&amp;gt;247, 9=&amp;gt;2, 11=&amp;gt;560}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But instead of grouping by &lt;code&gt;tracker_id&lt;/code&gt;, I would like to group by &lt;code&gt;tracker_name&lt;/code&gt;, to get this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{&quot;name_1&quot;=&amp;gt;446, &quot;name_2&quot;=&amp;gt;247, &quot;name_3&quot;=&amp;gt;2, &quot;another_name&quot;=&amp;gt;560}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Is there a way to do this directly, without any mapping operation / hash renaming ?&lt;/p&gt;</description>
         <author>ste26054</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32861858</guid>
         <pubDate>Wed, 30 Sep 2015 08:52:53 +0000</pubDate>
      </item>
      <item>
         <title>Ruby Time.now.to_i PHP equivalent</title>
         <link>http://stackoverflow.com/questions/32794921/ruby-time-now-to-i-php-equivalent</link>
         <description>&lt;p&gt;Any idea how can I get the same result as with Ruby in PHP? Unix epoch time.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;timeint = Time.now.to_i
puts timeint
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;1443253948&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I tried &lt;code&gt;http://php.net/manual/en/function.time.php&lt;/code&gt; but not much good result.&lt;/p&gt;

&lt;p&gt;EDIT:&lt;/p&gt;

&lt;p&gt;Seems this does the trick, never thought about:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$epoch = time();
&lt;/code&gt;&lt;/pre&gt;</description>
         <author>bsteo</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32794921</guid>
         <pubDate>Sat, 26 Sep 2015 07:53:16 +0000</pubDate>
      </item>
      <item>
         <title>Unable to install json - Ubuntu 14.04 - Rails</title>
         <link>http://stackoverflow.com/questions/32619098/unable-to-install-json-ubuntu-14-04-rails</link>
         <description>&lt;pre&gt;&lt;code&gt;gem install json
Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    /home/user/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20150916-3216-1xudd6p.rb extconf.rb
creating Makefile

make &quot;DESTDIR=&quot; clean

make &quot;DESTDIR=&quot;
compiling generator.c
linking shared-object json/ext/generator.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [generator.so] Error 1

make failed, exit code 2

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.2.3/gems/json-1.8.3 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hey. I'm trying to push to heroku but hit a dead end with this. First, there was the sqlit3 problem. Now, I'm unable to install json when I type bundle. What should I do now?&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description>
         <author>Aiyoyo</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.32619098</guid>
         <pubDate>Wed, 16 Sep 2015 21:30:28 +0000</pubDate>
      </item>
      <item>
         <title>Ruby-Mp3Info error when saving/closing a file</title>
         <link>http://stackoverflow.com/questions/24496558/ruby-mp3info-error-when-saving-closing-a-file</link>
         <description>&lt;p&gt;I've upgraded to the new mp3info GEM and now there seems to be a problem when it comes to writing the changes to the MP3 tags.  Ruby version 1.9.3, mp3info version 0.8.4, Windows 7 - 64 bit.&lt;/p&gt;

&lt;p&gt;Simple program:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'mp3info'
mp3 = Mp3Info.open('a.mp3')
mp3.title = 'bogo'
mp3.close
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Results in:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Errno::EACCES: Permission denied - (./.a.mp3.tmp, a.mp3)
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-mp3info-0.8.4/lib/mp3info.rb:453:in `rename'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-mp3info-0.8.4/lib/mp3info.rb:453:in `close'
from (irb):6
from D:/Ruby193/bin/irb:12:in `&amp;lt;main&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I've checked permissions on the file/folder, and I'm running as Administrator in the CMD shell.&lt;/p&gt;</description>
         <author>JRQ</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.24496558</guid>
         <pubDate>Mon, 30 Jun 2014 18:26:15 +0000</pubDate>
      </item>
      <item>
         <title>Rails 4: assets not loading in production</title>
         <link>http://stackoverflow.com/questions/18700219/rails-4-assets-not-loading-in-production</link>
         <description>&lt;p&gt;I'm trying to put my app into production and image and css asset paths aren't working.&lt;/p&gt;

&lt;p&gt;Here's what I'm currently doing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image assets live in /app/assets/images/image.jpg &lt;/li&gt;
&lt;li&gt;Stylesheets live in /app/assets/stylesheets/style.css&lt;/li&gt;
&lt;li&gt;In my layout, I reference the css file like this: &lt;code&gt;&amp;lt;%= stylesheet_link_tag    &quot;styles&quot;, media: &quot;all&quot;, &quot;data-turbolinks-track&quot; =&amp;gt; true %&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Before restarting unicorn, I run &lt;code&gt;RAILS_ENV=production bundle exec rake assets:precompile&lt;/code&gt; and it succeeds and I see the fingerprinted files in the &lt;code&gt;public/assets&lt;/code&gt; directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I browse to my site, I get a 404 not found error for &lt;code&gt;mysite.com/stylesheets/styles.css&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;What am I doing wrong?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;
In my layout, it looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;%= stylesheet_link_tag    &quot;bootstrap.min&quot;, media: &quot;all&quot;, &quot;data-turbolinks-track&quot; =&amp;gt; true %&amp;gt;
&amp;lt;%= stylesheet_link_tag    &quot;styles&quot;, media: &quot;all&quot;, &quot;data-turbolinks-track&quot; =&amp;gt; true %&amp;gt;
&amp;lt;%= javascript_include_tag &quot;application&quot;, &quot;data-turbolinks-track&quot; =&amp;gt; true %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The generate source is this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;link data-turbolinks-track=&quot;true&quot; href=&quot;/stylesheets/bootstrap.min.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; /&amp;gt;
&amp;lt;link data-turbolinks-track=&quot;true&quot; href=&quot;/stylesheets/styles.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; /&amp;gt;
&amp;lt;script data-turbolinks-track=&quot;true&quot; src=&quot;/assets/application-0c647c942c6eff10ad92f1f2b0c64efe.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Looks like Rails is not properly looking for the compiled css files. But it's very confusing &lt;em&gt;why&lt;/em&gt; it's working correctly for javascripts (notice the &lt;code&gt;/assets/****.js&lt;/code&gt; path).&lt;/p&gt;</description>
         <author>emersonthis</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.18700219</guid>
         <pubDate>Mon, 09 Sep 2013 14:09:53 +0000</pubDate>
      </item>
      <item>
         <title>Activeadmin: disable pagination when exporting xml/json</title>
         <link>http://stackoverflow.com/questions/14733798/activeadmin-disable-pagination-when-exporting-xml-json</link>
         <description>&lt;p&gt;How can I disable pagination for json/xml export in activeadmin? I could't figure out any solution for this. I'm getting only current page when hitting export to xml or json.&lt;/p&gt;</description>
         <author>RomanKapitonov</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.14733798</guid>
         <pubDate>Wed, 06 Feb 2013 16:21:33 +0000</pubDate>
      </item>
      <item>
         <title>How can I skip a specific validation when importing data?</title>
         <link>http://stackoverflow.com/questions/13686671/how-can-i-skip-a-specific-validation-when-importing-data</link>
         <description>&lt;p&gt;How can I skip a specific model validation when importing data?&lt;/p&gt;

&lt;p&gt;For example, suppose I have this model:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Account
  validates :street_address, presence: true
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Normally, I don't want accounts to be saved without addresses, but I'm also going to convert a lot of data from an old system, and many accounts there don't have addresses.&lt;/p&gt;

&lt;p&gt;My goal is that I can add the old accounts to the new database, but in the future, when these accounts are edited, a street address will have to be added.&lt;/p&gt;

&lt;h2&gt;Clarification&lt;/h2&gt;

&lt;p&gt;As I said, I want to skip a &lt;strong&gt;specific&lt;/strong&gt; validation; others should still run. For example, an account without an account number shouldn't be loaded into the new system at all.&lt;/p&gt;</description>
         <author>Nathan Long</author>
         <guid isPermaLink="false">http...stackoverflow.com.q.13686671</guid>
         <pubDate>Mon, 03 Dec 2012 15:43:37 +0000</pubDate>
      </item>
   </channel>
</rss>
<!-- fe6.yql.bf1.yahoo.com compressed/chunked Thu Oct  1 14:59:31 UTC 2015 -->
