ruby-on-rails

Are there any Simple and Clean Methods to implement Maps (Google or otherwise) in RoR 3?

I'm looking into building a group work app for my final year project next year. One of the core parts is organising group meetings. I plan to make this as powerful as possible and adding a map can help get rid of excuses such as "I didn't know where it was". I have been unable to find any simple solutions to embed maps into my Rails app...

Having trouble generating thumbnails in Rails on Windows (using dragonfly / rmagick)

I'm modifying an existing Rails application that works fine on OS/X, but I'm using windows. The issue is that the resized images that dragonfly is generating don't work. The error I'm getting is: RuntimeError: ImageMagick library function failed to return a result. ImageMagick is installed and properly pathed and the .dlls seem to be...

Rails MVC Best Practices for Website Modules

I am just beginning to build my Rails application and thus far I've followed a RESTful design and it's proven much easier to understand and organize the code and structure of the application. I have things like posts and comments. However for the front page. I want to display all the latest posts but also may be in the sidebar display th...

case insensitive in searchlogic

Hi, Can Searchlogic search with case insensitivity? Thanks, Jay ...

Regular Expression Routes in Rails

I am looking to create a rails route that is capable of accepting requests using a regular expression. Specifically, I need optional paths. As an example: "(/first)?(/second)?" Would match: /first /second /first/second But not: /second/first Is this possible? Thanks. ...

Design pattern to integrate Rails with a Comet server

I have a Ruby on Rails (2.3.5) application and an APE (Ajax Push Engine) server. When records are created within the Rails application, i need to push the new record out on applicable channels to the APE server. Records can be created in the rails app by the traditional path through the controller's create action, or it can be created by...

acts_as_taggable_on and auto_complete returning no results

I'm using acts_as_taggable_on in a model, and am trying to implement the auto_complete plugin. It seems as though I have everything hooked up correctly, but the search isn't returning any results. Here's what I have so far: In the view: <%= text_field_with_auto_complete(:link, :tag_list, {}, {:tokens => ','}) %> In the controller: ...

How to render a Partial from a Model in Rails 2.3.5

I have a Rails 2.3.5 application and Im trying to render several Partials from within a Model (i know, i know -- im not supposed to). The reason im doing this is im integrating a Comet server (APE) into my Rails app and need to push updates out based on the Model's events (ex. after_create). I have tried doing this: ActionView::Base.n...

How to configure Ruby ob Rails for XAMP server?

I have installed Ruby On Rails Application on my harddrive, and i am using XAMPP server. But i was not able to configure it to use on XAMPP server, do Ruby on Rails run on XAMPP server or need some other server like webrick or lighttpd...?? ...

Why render_component is depreciated ?

Hi All, Why render_component is depreciated in rails > 2, What is the rational behind that ? Thanks cheers sameera ...

Rails error when using %d (deprecated) on translating dates, what should i use instead?

in language file es.yml i have time: formats: short: "%d %b %H:%M" when i try using it like: <%= l my_object.created_at, :format => :short %> it shows the following error ActionView::TemplateError (missing interpolation argument in "%{count} %b %H:%M" ({:object=>Fri, 11 Jun 2010 09:00:00 CDT -05:00} given)) o...

generating XML in rails

I created a controller having an action: def gen_books_xml @books = Book.find(:all, :conditions => {:owner_id => 1}) respond_to do |format| format.xml { render :xml => @books.to_xml(:root => "Books", :skip_types=>true) } end end How could I implement the to_xml method in the Book model sa that it can generate the following f...

current_user.user_type_id = @employer ID

I am building a system with a User model (authenticated using AuthLogic) and three user types in three models: one of these models is Employer. Each of these three models has_many :users, :as => :authenticable. I start by having a new visitor to the site create their own 'User' record with username, password, which user type they are, e...

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...

how to use model in different controller in RoR

i have a profile controller.but i want to use User model to save some fields in users table.So how can i load User model in profile controller ...

Regex for removing certain variable numeric values from some text

I want to substitute all 4 instances of the number 300 from the code below (which my website users will be pasting whenever they create a new blog post), with 470. <div> <object width="300" height="300"> <embed src="link-removed" width="300" height="300"></embed> </object> <p> <a href="another-link">link</a> </p> </div> ...

Disjunction in ActiveRecord

Is it possible to use ActiveRecord named_scopes to create one query with sql OR clauses? When I use Model.scope1.scope2 generated query is conjunction of these scopes. ...

RiCal add_attendee issue

I am using RiCal gem to create calendar event in my ROR project. The issue i have is when i add attendee it adds the attendee as . ATTENDEE:mailto:[email protected] ATTENDEE:mailto:[email protected] But I want ATTENDEE as ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP= TRUE;[email protected]...

Alias method chain in ruby calling itself

I am rewriting the controller render method, however, I want to use the old method when in the render_to_string method. These are my current codes: def render_with_xhr(options = {}, extra_options = {}, xhr_check = true, &block) if xhr_check && request.xhr? template = render_to_string(options) render_without_xhr(:update) {|page...

How to pass a collection to a controller's action(not by GET)

I'm working with Ruby on rails 2.3.8 and the idea is to implement a "Sort" functionality for search results. I've got the view(this is a part of it): <span>Sort by:</span>&nbsp;&nbsp; <%= link_to 'MORE RELEVANT', search_filter_relevance_path %> Routes file: map.search_filter_relevance "/anuncios/search_filter_relevance", :controlle...