ruby-on-rails-3.2

Segmentation fault with Ruby 1.8.7

血红的双手。 提交于 2019-12-21 05:18:07
问题 I'm trying to use Rails 3.2.0.rc2 but I'm running into some problems. When I try to do a rails s I am now getting: /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/json-1.6.5/ext/json/ext/json/ext/parser.bundle: [BUG] Segmentation fault ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] [1] 28744 abort rails s What's interesting is that I am using 1.9.2 but the error seems to be related to 1.8.7. I have done the following to try to fix this problem w/ no success: rvm gemset

Nginx configuration resulting in too many connections

半腔热情 提交于 2019-12-21 05:11:05
问题 In an attempt to implement the upload progress module, the following server configuration is resulting in too many open files error 2014/11/19 12:10:34 [alert] 31761#0: *1010 socket() failed (24: Too many open files) while connecting to upstream, client: 127.0.0.1, server: xxx, request: "GET /documents/15/edit HTTP/1.0", upstream: "http://127.0.0.1:80/documents/15/edit", host: "127.0.0.1" 2014/11/19 12:10:34 [crit] 31761#0: *1010 open() "/usr/share/nginx/html/50x.html" failed (24: Too many

Is there a best practices/coherent way to update a database field that contains a hash key-value store?

試著忘記壹切 提交于 2019-12-21 04:32:16
问题 I'm referring to Rails 3.2's Data Store feature, in which there's the option to store key-value stores in a textfield, even if you're using a relational database like MySQL...it works fine when programmatically manipulating the fields. But what documentation is there to update these fields from a RESTful HTML form? Or is this something that's not recommended at all? That is, the better solution would be to go to NoSQL? 回答1: If I understand the question, I think you just need to declare the

Fields_for disappear when adding accepts_nested_attributes_for

廉价感情. 提交于 2019-12-21 03:53:08
问题 I'm doing a nested form in Rails 3.2.5, but when I add the accepts_nested_attributes_for my fields_for disappear (they just stop showing in my form). This are my models: class Product < ActiveRecord::Base attr_accessible :title, :description, :variants_attributes has_many :variants accepts_nested_attributes_for :variants validates :title, presence: true end My second model is class Variant < ActiveRecord::Base belongs_to :product attr_accessible :price, :sku, :weight, :inventory_quantity,

Rails 3 - set the filename in a respond_to

ⅰ亾dé卋堺 提交于 2019-12-21 03:33:23
问题 This seems like it should be simple, but I can't seem to find a straight answer. I have added a csv mime-type, and the following seems to work, except that the downloaded file is always named "report.csv". In my controller: def report respond_to do |format| format.html format.csv do render :template => "summary/report.csv.erb", :filename => "foo" #doesn't work end end end I think it's using the default renderer (I haven't implemented an alternate renderer), but I can't seem to find complete

Why is Google PageSpeed Insights telling me to minify javascript & CSS (using Rails 3.2 with JS & CSS compression) and how to fix?

▼魔方 西西 提交于 2019-12-20 21:56:33
问题 I know it's not a lot I could save in KB, but to achieve a better score in Google PageSpeed Insights, and thus probably better SEO ranking, how can I fix this? From https://developers.google.com/speed/pagespeed/insights/?hl=en&url=www.tradebench.com : Minify JavaScript for the following resources to reduce their size by 2.8KiB (2% reduction). Minifying http://d2bfamm4k6zojq.cloudfront.net/…tion-ea806932c941fb875b7512a557ebead3.js could save 2.8KiB (2% reduction) after compression. It tells me

How to use and configure omniauth with yahoo, google, facebook strategies in various environments?

淺唱寂寞╮ 提交于 2019-12-20 16:47:31
问题 I'm working on a Rails 3.2 application that will allow users to authenticate with multiple providers ... Yahoo, Google, Facebook and/or Twitter. We are using omniauth, and while I understand the basic workflow, I cannot find an inclusive document that states how each of these specific providers should be configured nor how a Rails application should be set up so that I can properly test/use these strategies in development, test and production environments. So my questions: For each of these

Rails remote delete and update view through Ajax

落爺英雄遲暮 提交于 2019-12-20 14:06:12
问题 In the past, whenever I wanted to update a part of my view through Ajax, I've done the following: create a partial out of the part I want to update and give it a unique ID, say #tracks create a special action in the controller for that Ajax call, say remove_track that updates all the values, etc. and add format.js create a new JS file with the same name as the action so Rails calls it automatically remove_track.js.erb which contains something like: $('#tracks').html("<%=j render 'cds/show

Rails remote delete and update view through Ajax

偶尔善良 提交于 2019-12-20 14:06:06
问题 In the past, whenever I wanted to update a part of my view through Ajax, I've done the following: create a partial out of the part I want to update and give it a unique ID, say #tracks create a special action in the controller for that Ajax call, say remove_track that updates all the values, etc. and add format.js create a new JS file with the same name as the action so Rails calls it automatically remove_track.js.erb which contains something like: $('#tracks').html("<%=j render 'cds/show

Can I run a Rails engine's specs from a real app which mounts it?

妖精的绣舞 提交于 2019-12-20 12:37:08
问题 I have a Rails Engine meant to provide some models and controllers to a larger project of ours. There's a pretty decent set of specs for the Engine, using a bunch of mocks and some full-scale models and controllers within the engine's dummy app to make sure the Engine is doing what it's supposed to and working with the larger application. However, even with all tests passing, I frequently find broken behavior when I update the engine in the larger application. If my tests are passing but the