ruby-on-rails-plugins

Getting gcal4ruby gem to work

99封情书 提交于 2019-12-13 03:47:02
问题 I'm trying to create a RoR web application that allows people to connect to their accounts to google calendar. I found a gem called gcal4ruby that seemed to do the right things based on looking at sample code and its documentation. I ran gem install and the cmd claimed the installation was ok. However, when I added the gem to my gemfile then try to run the server again I get: Could not find 'gcal4ruby (= 0.0.5, runtime)' in any of the gem sources Try running 'bundle install'. Then I tried

Rails 3.0.0.beta and Facebooker: anyone else seeing the following?

天大地大妈咪最大 提交于 2019-12-12 11:56:42
问题 My rails server seems to break after installing the facebooker plugin. Any suggestions on fixing this would be great. I'm using rails 3.0.0.beta and facebooker. Here are the steps and the error that I'm seeing: $ rails -v Rails 3.0.0.beta $ rails break; cd break $ ./script/rails plugin install git://github.com/mmangino/facebooker.git $ vim Rakefile #and add "require 'tasks/facebooker'" $ ./script/rails server => Booting WEBrick => Rails 3.0.0.beta application starting in development on http:/

Add methods to a Rails engine model from a Rails plugin

瘦欲@ 提交于 2019-12-12 04:38:16
问题 I'm writing a Rails plugin to extend a Rails engine. Namely MyPlugin has MyEngine as a dependency. On my Rails engine I have a MyEngine::Foo model. I'd like to add new methods to this model so I created a file in my plugin app/models/my_engine/foo.rb which has the following code: module MyEngine class Foo def sayhi puts "hi" end end end If I enter the Rails console on the plugin dummy application I can find MyEngine::Foo , but runnning MyEngine::Foo.new.sayhi returns NoMethodError: undefined

Can a Rails plugin be packaged as a WAR/JAR file?

允我心安 提交于 2019-12-11 06:47:16
问题 Can a plugin be packaged as a JAR/WAR file similar to the way in which an entire Rails app can be packaged for deployment on JRuby? 回答1: either you want warbler or you want to make a jar. If you need an empty rails app with that plugin, create an empty project, install the plugin and, edit config/warble.rb to copy the gems you need If you need a jar with class files from that plugin; you need jrubyc to compile the rb files to class files that you can then turn into a jar with the java jar

Page Caching for rails 3

情到浓时终转凉″ 提交于 2019-12-11 06:32:27
问题 How to do page caching in rails 3. Is there is any plugins or gem for that? whether page_cache_fu will work for rails 3? 回答1: You can do it directly in the controller. Below is directly from the Rails Guide class ProductsController < ActionController caches_page :index def index @products = Products.all end end 回答2: watch this video: http://railslab.newrelic.com/2009/01/22/page-caching - it was created before the rails 3 days, but I'd imagine it's still quite relevent hope it helps 来源: https:

undefined method `model_name'

三世轮回 提交于 2019-12-11 05:45:54
问题 i am getting this undefined method for albums controller and model any solutions?... undefined method `model_name' for ActiveRecord::Relation:Class Extracted source (around line #6): 3: >> 4: new album 5: 6: = form_for @albums do |f| 7: = f.error_messages 8: %p 9: = f.label :name =link_to 'albums', albums_path >> new album = form_for @album do |f| = f.error_messages %p = f.label :name = f.text_field :name %p = f.label :description = f.text_field :description, :rows => 3 %p = f.submit %p= link

RoR2.8 & Heroku: I installed a plugin, works locally, now heroku doesn't work at all

假装没事ソ 提交于 2019-12-11 03:46:18
问题 heroku logs brings up: ==> dyno-3334279.log (crash) <== /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/conditions.rb:81:in `method_missing': undefined method `has_attached_file' for #<Class:0x2baaa6077e58> (NoMethodError) from /app/fd916ea6-bad5-440e-a560-405ef5e3beee/home/.bundle/gems/ruby/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/association_conditions.rb:19:in `method_missing' from /app/fd916ea6-bad5

Acts as Tree with Multiple Models

白昼怎懂夜的黑 提交于 2019-12-11 02:15:53
问题 I've got several models that I'd like to relate together hierarchically. For simplicity's sake, let's say I've got these three: class Group < ActiveRecord::Base acts_as_tree has_many :users end class User < ActiveRecord::Base acts_as_tree belongs_to :group has_many :posts end class Post < ActiveRecord::Base acts_as_tree belongs_to :user end Under the current acts_as_tree, each node can individually can relate hierarchically to other nodes provided they are of the same type. What I'd like is

In Ruby on Rails, what's the difference between installing something as a gem or as a plugin?

妖精的绣舞 提交于 2019-12-10 20:50:58
问题 On http://github.com/collectiveidea/delayed_job it says: To install as a gem, add the following to config/environment.rb: config.gem 'delayed_job' Run rake gems:install versus To install as a plugin: script/plugin install git://github.com/collectiveidea/delayed_job.git What is the difference between installing it as a gem or as a plugin? Also, the first method just install gem 2.0.3 which might be the tobi's version? ( rake gems:install installs the version by gem list -r delayed_job ) Is it

Marking a string as HTML safe

筅森魡賤 提交于 2019-12-10 11:47:45
问题 I am trying to build my first Rails application and I'm using Ryan Heath's navigation_helper plugin to give me the current class in my navigation. I built my named routes as follows: match 'games' => 'games#index', :as => :games match 'new' => 'games#new', :as => :new match 'previous' => 'games#previous', :as => :previous match 'settings' => 'settings#index', :as => :settings Then in my application_layout I added the following code <%= navigation([:games, :new, :previous, :settings]).html