ruby-on-rails-plugins

Which State Machine plugin do you recommend for Rails? [closed]

孤人 提交于 2019-12-21 17:25:45
问题 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 6 years ago . I am looking for a relatively simple state machine plugin for a Rails 3 / Active Record project. I've done a little research and come up with the following plugins: Transitions : https://github.com/qoobaa/transitions Extracted from old Active Record State Machine Library Acts_As_State_Machine : https://github

How to override Rails app routes from an engine?

左心房为你撑大大i 提交于 2019-12-21 17:14:37
问题 I have a Rails app that I am trying to integrate a Rails engine in to. The host app has some catch all routes: # magic urls match '/' => 'admin/rendering#show' match '*path/edit' => 'admin/rendering#show', :defaults => { :editing => true } match '*path' => 'admin/rendering#show' It looks like the engine routes are loaded after the application catches all routes. /sitemap.xml(.:format) {:format=>"xml", :controller=>"admin/sitemaps", :action=>"show"} /(.:format) {:controller=>"admin/rendering",

Using jQuery plugins in Rails 3

不羁岁月 提交于 2019-12-21 09:13:04
问题 Having finished Hartl's great Rails Tutorial I'm now working my way through the very good jQuery - Novice to Ninja by Castledine and Sharkie. While I've able to include jquery.js and jquery-ui.js in my rails projects, I'm getting stuck when it comes to adding other jQuery plugins. I've figured out that when the plugins are hosted on github, I can import them into my project using the command line and: [my rails app]$ rails install [github URL] The plugin gets successfully imported into the

Problem with require rack/openid in Rails 3 [native require work properly]

一曲冷凌霜 提交于 2019-12-21 04:27:40
问题 I install plugin open_id_authentication and have this error: /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to load -- rack/openid (LoadError) when I try to start rails server Actually, rack-openid installed in my system and i can load it from irb: irb(main):001:0> require 'rack/openid' => true I tried to add hack to Gemfile as I did with ruby-openid, but it did't help: gem "ruby-openid", :require => "openid" gem "rack

acts_as_list with has_and_belongs_to_many relationship

时间秒杀一切 提交于 2019-12-21 03:56:20
问题 I've found an old plugin called acts_as_habtm_list - but it's for Rails 1.0.0. Is this functionality built in acts_as_list now? I can't seem to find any information on it. Basically, I have an artists_events table - no model. The relationship is handled through those two models specifying :has_and_belongs_to_many How can I specify order in this situation? 回答1: I'm assuming that you have two models - Artist and Event. You want to have an habtm relationship between them and you want to be able

How to get the list of all engines in Rails 3 app

落花浮王杯 提交于 2019-12-20 23:32:00
问题 According to Rails engines extending functionality in Rails 2.x one could do Rails::Initializer.new(Rails.configuration).plugin_loader.engines This code is not working in Rails 3 ActionController::RoutingError (undefined method `new' for Rails::Initializer:Module): config/application.rb:12:in `require_or_load' What do I need to do in Rails 3 to get such list of engines? This is needed for Extending controllers of a Rails 3 Engine in the main app 回答1: As of 5/10/2011 and Rails 3.1 beta, it's

How to get the list of all engines in Rails 3 app

蓝咒 提交于 2019-12-20 23:30:05
问题 According to Rails engines extending functionality in Rails 2.x one could do Rails::Initializer.new(Rails.configuration).plugin_loader.engines This code is not working in Rails 3 ActionController::RoutingError (undefined method `new' for Rails::Initializer:Module): config/application.rb:12:in `require_or_load' What do I need to do in Rails 3 to get such list of engines? This is needed for Extending controllers of a Rails 3 Engine in the main app 回答1: As of 5/10/2011 and Rails 3.1 beta, it's

Rails3 and Paperclip

本秂侑毒 提交于 2019-12-20 15:08:10
问题 I have migrated my application from rails 2.3 to rails3 and i have a problem with paperclip. I saw there was a branch for rails3 on paperclip git. So I added "gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git', :branch => 'rails3'" into the Gemfile and launch the command bundle install. Once paperclip installed, the upload worked fine but not the styles. I saw a hack to fix it. # in lib/paperclip/attachment.rb at line 293 def callback which #:nodoc: # replace this line... #

Rails: Management of read/unread messages

无人久伴 提交于 2019-12-20 09:09:52
问题 for a forum-like application I need the ability to show each user the unread (new) messages. Is there any Rails plugin/gem for that purpose? Or: Are there any hints to do this job in a efficent way? I'm thinking about an additional database-table storing the unread-status (or read-status?) of every message for every user. But this seems to be brute-force method, perhaps there is a smarter solution... Best wishes, Georg 回答1: In the meantime I have created a Rails plugin based on my idea above,

Render engine within application layout

回眸只為那壹抹淺笑 提交于 2019-12-20 08:57:22
问题 Background I am creating a application that is made up of a core and several modules. The modules are rails engines, and provide the actual functionality as the core itself only acts as a host. The engines are hosted from /lib and mounted at their respective paths. coreApp └──lib ├── module1 ├── module2 └── etc The modules are then mounted like this mount Module1::Engine => "/module1", :as => "module1" mount Module2::Engine => "/module2", :as => "module2" The core is also responsible for