ruby-on-rails-plugins

what is the best to use - ruby gems or ruby plugins

Hi All, What is the best practice when creating a rails project 1 - is it good to use ruby gems 2 - or is it good to use ruby plugins (as almost all the gems has their plugin versions) and what are the strengths and weaknesses of eachoption consider we are creating the rails project with rails 2.x.x or rails 3 thanks in advance ...

rails jquery slider and textile editor conflict

hello! i have a conflict between different jquery parts. i have a rails app and in there i have an internal area where admins can administrate the whole page and for that i put in a textile editor. outside i created a jquery slider for nicer overview. myTitle <%= javascript_include_tag 'jquery-1.4.2'%> <%= javascript_include_tag 'jq...

Rails Plugin - Install as Plugin or Install As Gem

Hey guys, I am new to rails and have a question regarding the plugins. It seems there are two approaches you can take when using a third party plugin in a ROR App: 1) install a gem using sudo gem install GEM, and then "require" it in your rails project 2) install the plugin using script/generate plugin install PLUGIN. The plugin in c...

Warning while installing the rails plugin

Hi...I am getting the following warning while installing any plugin in my rails application. /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/agnostics.rb:7: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 Can someone please tell me how to solve this problem? Thanks ...

Rails plugin for Group of users

Hello, My Rails application have a User model and a Group model, where User belongs to a Group. Thanks to this, a user can be a admin, a manager, a subscriber, etc. Until recently, when for example a new admin need to be create on the app, the process is just to create a new normal account, and then an admin sets the new normal account...

Should I include the binary in a Rails plugin or not?

Hello. I'm trying to roll out a little Rails plugin that is basically is just a wrapper to a 7zip archiver. Should I include the 7zip binaries for windows, mac and linux with it or explain to user that it's a dependency and they need to get it working. I know it's not that difficult to install a 7zip, but what is the best practice in...

OpenID Authentication using AuthLogic Error

Hi, I am trying to implement openid authentication using authlogic. I have installed the open_id_authentication in the process but when I entered rake open_id_authentication:db:create --trace I get the following error (in /Users/felix/login) rake aborted! Don't know how to build task 'open_id_authentication:db:create' /usr/local/lib/r...

Update User Info with restful_authentication plugin in Rails?

I want to give the users the ability to change their account info with restful_authentication plugin in rails. I added this two methods to my users controller: def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) # Only update password when necessary params[:user].delete(:p...

Limiting the Amount of Tags for Acts as Taggable On

Hello, I am wondering how to limit the amount of tags, the tag_cloud function returns for this plugin. http://github.com/collectiveidea/acts-as-taggable-on Also, I would like to know how to order it so that it orders the tags by the highest count. So the most popular are at the top. I tried to do @tags = Post.tag_counts_on(:tags, :limi...

Add JSON support to Rails app

I am experimenting with Rails and was wondering what's needed to allow/add support for JSON requests? I have a vanilla installation of Rails 2.3.5 and the default scaffolding seem to provide support for HTML & XML requests but not JSON. class EventsController < ApplicationController # GET /events # GET /events.xml def index @...

Repeated Rake Task Using Delayed Job

Hello, I am currently using the delayed_job gem and I was wondering how to run a rake task every 5 minutes. I want to run "rake ts:reindex RAILS_ENV=production" every 5 minutes but I'm not sure where to start. I really don't have much more I can say about this because I am VERY inexperienced in this area of rails development. ...

Rails 3 plugin - Generate a custom migration file

Hi, On this article http://www.themodestrubyist.com/2010/03/16/rails-3-plugins---part-3---rake-tasks-generators-initializers-oh-my/ we can see the following codes which allow to invoke a migration file: class ActsAsTaggableOnMigrationGenerator < Rails::Generators::Base invoke "migration", %(add_fields_to_tags name:string label:string...

Starting out with vote_fu

Hi All, Trying my luck with the vote_fu rails plugin. The functionality looks like exactly what I need for a project of mine, but I have hit a roadblock. I have followed the github readme to the letter, installing it as a plugin. I have put acts_as_voteable on my "Event" model and acts_as_voter on my User model. In the console, when I ...

What do I need to change to get this 'acts_as_rateable' Rails plugin working with this code from the Foundation Rails 2 book??

Hello! I'm working my way through the 'Foundation Rails 2' book. In Chapter 9, we are building a little "plugins" app. In the book, he installs the acts_as_rateable plugin found at http://juixe.com/svn/acts_as_rateable. This plugin doesn't appear to exist in 2010 (the page for this "old" plugin seems to be working again...it was down wh...

using rails: how to display all contents of a subfolder in an rails application?

hi, i would like to display the all contents of a folder in my site. For example, under www.mysite.com, I have a folder called "myfiles". In regular apache setting, if I type: http://www.mysite.com/myfiles/ and if myfiles does not have index.html or index.php, then I can get this: **Index of /mysite/myfiles** Parent Directory Chang...

How to Uninstall A Plugin (Seed Fu) From Rails

Hi, We installed Seed Fu to add in seed data in rails, then noticed that it isn't working right - doing some digging, we realized that Rails 2.3.8 comes with seeding built in, and seed fu might be deprecated. Now we're trying to uninstall seed fu, but are not sure of the right way to do it. We installed seed fu using script/plugin in...

How do I use Haml in a view in my new plugin?

I'm creating a new plugin for a jruby on rails application that will eventually be turned into a gem. Inside my plugin I have controllers, helpers and views. For my views I'd like to use Haml. The problem is that I can't seem to get it to recognize that they are haml templates. Is it even possible to do this? Is there a way for a plugin ...

paperclip plugin not support for I18n

I've added I18n support for error messages: Now you can define translations for the errors messages in e.g. your YAML locale file: en: paperclip: errors: attachment: size: "Invalid file size" content_type: "Unsupported content type" presence: "Cant' be blank" when I use validates_attachemnt_zie :a...

Rails Engine: Extend model with application class

I Have an engine in vendor/plugins. My problem is, that i seemingly can´t extend the engine-model with a model in the base application. My folder structure: APPNAME -app -models -item.rb -vendor -plugins -image_gallery -app -models -image_gallery.rb Nothing special... in my image_gallery.rb i have just this...

Rails Custom Plugin/Gem with Partials

I am writing a gem which provides helpers for views. The HTML I want to insert via the helper is complex enough that I'd rather write it in a _partial.html.erb file. How do I get the gem's view path include in the application's load_path? Note: the only gem I've found that does something like this is Devise. When a view cannot be found,...