ruby-on-rails-3.2

Postgres.app upgrade, now Rails app won't start

一曲冷凌霜 提交于 2019-12-07 15:50:07
问题 I just upgraded my Postgres.app to latest version (9.2.4.1) am now unable to start my Rails app using Foreman or Rails server. /Users/memoht/Sites/myapp/.gem/ruby/1.9.3/gems/pg-0.15.1/lib/pg.rb:4:in `require': dlopen(/Users/memoht/Sites/myapp/.gem/ruby/1.9.3/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: @executable_path/../lib/libssl.1.0.0.dylib (LoadError) Referenced from: /Applications/Postgres.app/Contents/MacOS/lib/libpq.dylib Reason: image not found - /Users/memoht/Sites

Rails Blog engine [closed]

送分小仙女□ 提交于 2019-12-07 14:26:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Looking for a simple blog engine that will support article management. I have standalone rails3.2x application and authentication system and I have to add blogging engine for site registered users. 回答1: Check out ruby-toolbox, here you can find appropriate tool for your goals. Blog engines are here 回答2: Just

deep nested accepts_nested_attributes_for not rendering attribute data in edit template

北战南征 提交于 2019-12-07 14:16:33
问题 I'm having a bit of a challenge with understanding accepts_nested_attributes_for. I have a Resident class that is composed of various child classes (address, doctor, guardian, etc). My understanding of the steps necessary to make accepts_nested_attributes_for work is as follows: Create the necessary association(s) Add accepts_nested_attributes_for :resource to the parent class whose form I will use to commit the nested attributes whitelist nested attributes like so. attr_accessible :address

Editing RefineryCMS 2.1 Menu Presenter to manipulate dom_id css and other attributes

六眼飞鱼酱① 提交于 2019-12-07 13:23:31
问题 I am currently trying to update an existing RefineryCMS app from gem version so I can be up to date add bootstrap 3 at the same time. gem "refinerycms", "~> 2.0.10" to gem "refinerycms", "~> 2.1.0" After removing outdated blocks and deleting a couple overridden views from the site's past I have got the site successfully functioning again with its current database's content. Now that Refinery has switched over to the Menu Presenter in exchange of the old partials. How can I add, remove and

Rails 3.2: Replace null values with empty string from json serialization

穿精又带淫゛_ 提交于 2019-12-07 12:50:13
问题 I am using Rails 3.2 serialization to convert ruby object to json. For Example, I have serialized ruby object to following json { "relationship":{ "type":"relationship", "id":null, "followed_id": null } } Using following serialize method in my class Relationship < ActiveRecord::Base def as_json(opts = {}) { :type => 'relationship', :id => id, :followed_id => followed_id } end I need to replace null values with empty strings i.e. empty double quotes, in response json. How can I achieve this?

Creating unique id for <fieldset> when using form_for Rails Nested Model Form

纵饮孤独 提交于 2019-12-07 10:52:49
问题 I have a nested model form in the style of this Railscast http://railscasts.com/episodes/196-nested-model-form-revised?view=asciicast I need to give each tag a unique ID. Currently, each field generated has a unique ID and name given by a helper method that assigns a unique ID to every association record. So that is taken cared of. However, this form has "fieldset" tags which isn't assigned an ID. I need a unique ID for each fieldset for jQuery manipulation purposes. Specifically, how do I do

Highcharts scrollbar not appearing

柔情痞子 提交于 2019-12-07 10:36:18
问题 For some reason, the scrollbar option for Highcharts is not working on my Rails 3.2.1 application. What is odd is that everything looks exactly the same as this: http://jsfiddle.net/highcharts/fj6d2/ ... except that the scrollbar is missing. I have the exact same code as that shown in the jsfiddle above, the graph appears on my local application, but the scrollbar is missing. This is the code in my local app, the same as in the jsfiddle: var chart = new Highcharts.Chart({ chart: { renderTo:

Ruby class naming convention with double colon

我的未来我决定 提交于 2019-12-07 10:24:53
问题 I know the :: in Ruby is a scope resolution operator to access methods within modules and classes, but is it proper to name classes using :: ? Example class Foo::Bar::Bee < Foo::Bar::Insect def a_method [...] end end 回答1: If by “proper” you mean syntactically correct — yes . There's nothing inherently wrong with doing it, and if you're defining a subclass in a separate file (example below) then it's a relatively common practice. # lib/foo.rb module Foo end # lib/foo/bar.rb class Foo::Bar end

how to run rake task in background in rails

你。 提交于 2019-12-07 10:18:45
问题 This is my command bundle exec rake resque:work QUEUE="*" --trace I want to run this command on my server as a background process. please help me. 回答1: A method I often use is: nohup bundle exec rake resque:work QUEUE="*" --trace > rake.out 2>&1 & This will keep the task running even if you exit your shell. Then if I want to just observe trace output live, I do: tail -f rake.out And you can examine rake.out at any time. If you need to kill it before completion, you can find it with ps and

rake db:structure:dump fails under PostgreSQL / Rails 3.2

让人想犯罪 __ 提交于 2019-12-07 07:08:35
问题 I get this error message: pg_dump: too many command-line arguments (first is "demo_db") Try "pg_dump --help" for more information. rake aborted! Error dumping database Tasks: TOP => db:structure:dump (See full trace by running task with --trace) This used to work under Rails 3.1. I'm using Rails 3.2.3 and PostgreSQL 9.0.5. Other tasks like db:migrate or db:rollback work just fine. 回答1: The pg_dump command is executed in activerecord/lib/active_record/railties/databases.rake at line 428. `pg