ruby-on-rails

Thinking Sphinx Not Recognizing "set_property :min_prefix_len"?

I've been trying to get Thinking Sphinx for Ruby to handle prefixes and/or star, and every time i generate a new configuration file, it seems to ignore it. Here's the line I added: define_index do [... Stuff ...] set_property :min_prefix_len => 1 end And then I run: rake ts:config rake ts:in rake ts:run And nothing new. I ...

how do I install edge rails?

how do I install the latest, unreleased version of rails? i.e. edge rails? have followed some suggestions but still seem to have version 2.3.5... ...

How do I tell a signup page where to redirect to after submission in ruby on rails?

I have a ruby on rails app that has a signup page. Different pages redirect to the signup page and need to set another page to redirect to after the sign up is complete. What is the best way to do this? I'm currently doing this: link_to '/signup?redirect=/blah/page6 ...and getting the redirect variable in the signup controller and u...

Ruby on Rails ActiveRecord find_by-sql field names

Hi all, I'm doing custom find_by_sql queries which are dynamically created by user input. What is the best way to find the field names returned by find_by_sql I've tried using columns, column_names and keys methods but none work. Is the ActiveRecord result a hash or an array? e.g. @fm_reports = FmReport.find_by_sql(crosstab_query) fiel...

Include all stylesheets in a subdirectory in Rails

In my stylesheets directory I have application.css, ie_fixes.css, and a themes directory. The themes directory has about twenty css files in it. All of these stylesheets, minus the ie_fixes, are needed application wide, hence they are included in the application layout. The ie_fixes.css only needs to be included when the user's browse...

Page views in Rails

Hi Happy Holidays. I am not sure what is the best way to deal with this. I want to display page views and user views (How many unique users viewed a page). Is there a plugin for this? login_count is of course easy to check though. Just not sure about views. Google Analytics does the job well but I don't know whether it's to good to go...

Ruby-Debug Gem Install Problem on Windows

I'm having trouble installing the Ruby-Debug Gem on windows. What does this error mean? How can I fix this? Thanks C:\Users\Steve>gem install ruby-debug Building native extensions. This could take a while... ERROR: Error installing ruby-debug: ERROR: Failed to build gem native extension. C:/Ruby19/bin/ruby.exe extconf.rb Can't han...

Problem Installing Ruby-Debug on Windows

Any suggestions? C:\Users\Steve\barcoden>gem install ruby-debug Building native extensions. This could take a while... ERROR: Error installing ruby-debug: ERROR: Failed to build gem native extension. C:/Ruby/bin/ruby.exe extconf.rb creating Makefile make 'make' is not recognized as an internal or external command, operable progr...

Rails render XML of a INNER JOIN

I'm using 2 joined models class Product < ActiveRecord::Base has_and_belongs_to_many :providers end class Provider < ActiveRecord::Base has_and_belongs_to_many :products end and my controller looks like this class ProductsController < ApplicationController @products = Product.find( :all, :joins => :providers, ...

Executing a binary gem file with unpacked gems

I am using the gem whenever To update the crontab, it executes the whenever command in the root directory of my application. The trouble is: my production environment doesn't have the gem installed, so I unpacked the whenever gem into my application and running 'whenever' from my application root directory fails to find the file How d...

Does any one know good editor available in RoR for windows?

Does any one know good editor available in RoR for windows? ...

Config.gem in test and cucumber environments

With RSpec and Cucumber, why is it preferred to specify :lib => false in the environment files - and then explicitly require the gems in spec_helper.rb and env.rb? ...

how to set color in ruby pdf-writer

Hi folks. I'm using pdf-writer gem in ruby. While drawing a table, i need to set the shade_color and shade_color2 of table so that the rows get the alternate shade and shade2 colors. Can anyone tell me how to set them? Like table.shade2 = Color::RGB::Magenta But i have a hexa vaue like 989898. Now, how to use this. Any help is appr...

Rails select box autocomplete

I currently have a f.collection_select in my rails app. What is the best way to convert this into a text input box with autocomplete? ...

How to add cell-padding or cell-spacing in ruby pdf-writer

Hi folks, I have seen an ocean of options in pdf-writer Simple-Table, but it doesn't seem to have the cell-spacing and cell-padding. 1) Is it implemented, did i miss it? If so, can you plz gimme a line of code. 2) If not implemented, is there any work-around? Any help is appreciated. THanks ...

textile and maruku problem

Hi, all. I've developed custom filters for HAML (http://github.com/alec-c4/cb-haml-filters) and have a small problem with textile and maruku. Maybe you can help me with this Problem with textile with code %h2 Textile test :cbtextile h4. YouTube video http://www.youtube.com/watch?v=0_IXrjqKbE4&amp;feature=player_embedded ...

Ruby to_proc hack with binding

I'm trying to create a little Ruby hack to make something like the reverse of the Symbol#to_proc hack. Whereas the Symbol#to_proc hack makes this possible: some_array.each(&:some_method) is the same as some_array.each { |obj| obj.some_method } I want to make this possible: some_array.each(&[:some_method]) would be the same as ...

Rails, Prototype, periodically_call_remote: I want new call to have fade in effect

Hi, I have a div that is getting updated by periodically_call_remote. When this div is updated I want it to fade in. I know prototype will handle this but I am not sure how. for example: periodically_call_remote(:url => 'update', :frequency => '5', :update => 'ticker') When this content is updated I want it to fade in and fade ou...

Use the same parameters many times in a find conditions: hash

Hello, I have a model who holds 2 properties: valid_from and valid_to. I need to select all instances that are currently valid, i.e. valid_from <= today and valid_to >= today. i have the following find : Mymodel.find(:all, :conditions => ["valid_from <= ? and valid_to >= ?", Date.today, Date.today]) I already thought about storing D...

push rails app to heroku

I am trying to push a rails application to heroku. When I get to the last step: git push heroku master It doesn't work and gives me these errors: Counting objects: 85, done. Delta compression using up to 2 threads. Compressing objects: 100% (74/74), done. Writing objects: 100% (85/85), 24.38 KiB, done. Total 85 (delta 23), reused 0 ...