ruby-on-rails

Rails: SASS not creating the CSS files

SASS is not creating the CSS files, but HAML is working just fine. I ran the following command: $: sass --watch scss:stylesheets [true, ["scss", "stylesheets"]] My main.scss file contains the following: /* main.scss */ body { background: #000000; } The main.css file never gets generated. So I ran the following: $: sass --upd...

Ruby on Rails jQuery Visual Effect

I am working on a search function on RoR that basically just has a cool visual effect when a user clicks the search button. Here is the code in my view for search.rhtml <html> <head> <title>Tutor</title> <%= javascript_include_tag :defaults %> </head> <body> <h1></h1> <%= form_remote_tag :url =>{ :action =>...

Which version of Rails should I use

I'm looking to build a web interface for an existing Ruby app and I'm trying to figure out which version of Rails to use - the latest current version 2.3 or the soon-to-be-released version 3.0. The reasons for using 2.3 are pretty straightforward: it's the current version and it's stable. My reasons for considering 3.0 are: My app us...

how to send email from rails app with gmail address

I am trying to send a sample email from my rails application. this is what I've done so far: rails gmailtest cd gmailtest script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git Then I placed following in my environment.rb file (after the end) ActionMailer::Base.smtp_settings = { :address => "...

Rails 3.0.0.rc profiling: Thousands of Regexp#===(d1) calls

I was getting 0.5 reqs/s on the front page of my rails app (a very simple, mostly static page that made a couple of database calls, but nothing that WEBrick said took longer than 0.8 ms), served with thin. I added ruby-prof profiling tools to my ApplicationController via the instructions at Dan Mange's blog and dumped the call graph to s...

extended permissions in authlogic facebooker plugin?

How does one request extended permissions? Adding a :perms key to the hash <%#= authlogic_facebook_login_button :text => 'Login with Facebook', :v => 2, :perms => "email,user_birthday" %> causes the FBML to render as <form id='connect_to_facebook_form' method='post' action='/user_session'> <input type='hidden' name='authenticity_to...

Will replacing mongrel with Thin or Passenger improve scalability

Hi, I want to improve the scalability of my Rails app. Currently it runs on a apache/mongrel (mongrel cluster actually). Will replacing this with Thin or Passenger improve the scalability of my app? Thanks, Sivakumar. ...

How will Turbogears reach the critical mass of Ruby on Rails?

I've been using Turbogears since I have a Python background, but I can't help feeling a pang of jealously seeing all the Ruby on Rails resources available. For example, for a crude comparison of the volume of resources, check out http://www.google.com/trends?q=turbogears%2C+ruby+on+rails What would it take for Turbogears to reach the c...

gem install mysql is wrong!

OS:     Fedora 13 Question:     The mysql for rails. I inputed the command "gem install mysql" and the request is error. Error:     Error: Error installing musql:     ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb can't find header files for ruby. Gem files will remail installed in /usr/lib/ruby/gems/1.8/gems/m...

jeditable and rails 3

Hello ! I'm trying to use jeditable with my rails 3 apps. I would like to edit some fields inline. Actually it's working on my client side but the data isn't updated in my app. Could you take a look? Thanks in advance! my view: <dt>Overview :</dt> <dd class="edit_textfield" id="<%= @project.id %>" name="overview"><%= @project.overview...

Preseve line breaks from textarea in Rails controller submitted with submit_to_remote

I can't believe there isn't a standard way of doing this, but I'm submitting content from a textarea to a Rails controller, and it doesn't seem to preserve the line breaks (of any form). Here is my view code: f.text_area :keywords, :cols => 50, :rows => 10 submit_to_remote 'button', "#{t "add_keywords"}", :html => {:id => 'add...

Rails backgroud job processing

I am using starling as a queue server in my rails application. so each time i want to call worker method, I have to start starling and workling client from console. Is there a way where as soon as the passenger is started my workling and starling both get auto started Or preciously when i will call the worker method then only my worlin...

How to return truly empty body in rails? i.e. content-length 0

I'm trying to return a 200 status with an empty body but rails returns a body with a single space. i.e. content-length 1 For instance, this code generates a body with the single space respond_to do |f| f.html {head :ok} end and so does this respond_to do |f| f.html {render :nothing => true} end Yes, even render :nothing genera...

Trying to tell the difference between a bad resource link and a random bad url from outside the site.

Hi all. I'm trying to make my exception notification a bit smarter. Currently, if i have a bad resource link such as a misnamed javascript file referred to in a file link tag, it triggers a "No route matches" error. I also get a "No route matches" error if someone just types some random url (eg when trying to hack the site). I'm tryi...

Getting local time

I've got this time stored as a string: 2010-07-25 04:16:25 This is the GMT time for some action I took. Since I live in the Jerusalem time zone, I would like to show it at Jerusalem time, i.e. 07:16 in the morning, not the GMT time of 04:16:25 which is 3 hours before. How do I properly convert it programmatically with Ruby on Rails? ...

Custom extension in rails routes

I have to serve rails generated zip files. For example from the following REST route: http://foo.com/controller/show/filename.zip How i need to map routes.rb to allow the routing of zip files (instead searching for static files in /public) to my controller? ...

Storing longitude and latitude data in a database, and query for nearby records.

I am creating a rails application which will use geolocation. One can add a longi- and latitude to a record. If there are multiple records with geolocations, one can see a Google Map with nearby records, just like Twitter geolocation. How can I store the coordinates (I don't mind to do calculations) and find nearby records? My database ...

XMLHttprequest post method in rails

Hi all, how to send file through xmlhttprequest.send(file) in rails , post method not calling respective action(method) in the controller , get method calling the same action which specified in the post method and how to get the request(body) content in the controller ? Any idea? ...

good cheat sheat or ref card for Rails ActiveRecord

I'm just starting out with Rails and ActiveRecord. I feel that anything I want to make an association between two models (belongs_to, has_one, has_many) I have to read the documentation over and over to really understand it. Does anyone know of a good cheatsheet or refcard that makes the distinctions visible ? ...

link_to "about",about_path showing the error in ROR

hi , i am working in Ruby on rails.. i am new to this.. i have used a line <%= link_to "about",about_path %> which throws me a error as, undefined local variable or method `about_path' for #<ActionView::Base:0xb5f5baa8> i am having the page about.html under app/views/pages/ please give some suggestions of why i am get...