ruby-on-rails

'The page you requested was not found' after finish to invite users on facebook application

Hi, I tried create a invitation function on iFrame facebook application, but i have errors when submit it, so when user done invite a person, then it should redirect to action url that we set, but the page is not go to the right url, it says "The page you requested was not found." here is my code that i use : <fb:serverFbml> <scr...

Bundler puts my gems in my project directory

I have a Rails 3rc app on Ruby 1.9.2 that works fine, but Bundler keeps making a folder named "bandsintown" (bandsintown is a gem I use) in my project directory. From what I can tell, the folder has all my gems in it. I'm pretty sure that this never happened before. Is it normal behavior? I think this might be interfering with running t...

attachment_fu save thumbs as png

How do I save a thumbnail as a png using attachment_fu? The code below saves them as a jpeg. has_attachment :content_type => :image, :storage => :s3, :max_size => 6000.kilobytes, :thumbnails => { :thumb => 'crop: 160x112'} Thanks!! Deb ...

Easy Question : Where do gems install to?

I'm trying to edit one of the gem's config files and I can't find it.. not sure how i did this in the past. ...

Memcached is crashing a lot. Why?

I am using memcached and it seems to be crashing a lot lately. Sometimes a deploy can cause it to crash on ActionController::Base.cache_store.clear and sometimes it happens out of nowhere. How can I get to the root cause of this? Does it have it's own log somewhere? How can I make it more robust? Our site relies heavily on it and i...

Rails relational issue - Find user's next outing

I have an outings table, which basically holds some information about an 'outing'. These outings then have crews, which have users (through crew_users) Just as a note, outings have many crews, so there's an outing_id in the crews table Now, I need to find the user's next outing, as in the first outing where outing.start_time > Time.n...

Is there a nice way to share your cucumber features with your clients?

I LOVE cucumber, my clients love it too. As far as I know currently there isn't a nice way to share your features with your clients. Us nerds have TextMate or NetBean bundles that give us nice syntax highlighting -- my clients not so much. What I would love is to be have something hosted at features.myclientsapp.com that would be a or...

Ruby on Rails form f.text_area contains additional spaces

I have a quite average form in Rails, trough blog_kit <% form_for(@blog_post, :html => { :multipart => true }) do |f| %>\ ... other code <%= f.text_area :body %> <%= debug(@blog_post) %> When editing a blog-post, the body suddenly contains additional spaces (marked as _ to visualise): ...sit amet eleifend diam imperdiet pharetr...

How can I get a rails route to keep the extension as part of the id?

I have the following route defined: map.resources :images, :only => [ :index, :new, :destroy ] when I do a rake routes I get the following: image DELETE /images/:id(.:format) {:action=>"destroy", :controller=>"images"} My problem is, I would like to use file names as my :id including any extension. At the moment my ids are getting ...

Create plugins or gems for Rails 3?

I have features I would like to be portable between my own Rails applications. I wonder if I should create a gem or a plugin for each feature I want to be portable (sharable). They are just for Rails (for now) because they include css, html, js and image files. But I have been wondering, the things provided with plugins could be provi...

Sqlite on rails problem with relations

I have a problem with relations while using sqlite3 on rails. First i build my scaffolds, add the references to migration files, add belongs_to has_many to models than get my database up and runinig with basic rake db:migrate command. And then it doesn't work, I guess there is a missing step which i cannot figure out :S By the way i ...

Varnish + Rails causes invalid authenticity tokens in development

Here is my situation. I am testing out Varnish on my local box (I'm doing some stuff related to page caching that would be a big pain to push to staging every time). Everything works fine, except whenever I submit a form, I get an ActionController::InvalidAuthenticityToken exception. Varnish is running on localhost at port 6081, and Thi...

ruby on rails: export and merge databases

I am currently working on a ruby on rails project with a MySQL-Database. Is there a way to export the database and merge it with another one? ...

Scaling a Ruby on Rails site

I am developing a Ruby On Rails application and would like to deploy in a production environment. I have multiple identically configured Ubuntu web servers I can use but I don't know how to scale the RoR app and db data across multiple hosts. I'd like to put both a web server and a db server on each host. On the web server/ruby middle...

Does Django has testing tools comparable to what Rails has?

Hey, Ruby/Rails enjoy some really nice and powerful testing frameworks like Cucumber and RSpec. Does Python/Django enjoy the same thing (I'm not talking about simple unit testing like PyUnit)? Thanks for help and time. ...

Benefits of Sinatra for a web service like controller

I am writing a simple ruby controller that just needs to respond as a webservice to a bunch of mobile clients. Someone told me I should look into Sinatra. What is the point of using Sinatra for something this simple? He mentioned that it would be "faster" but how can a wrapper on top of something make it faster? I don't want to overco...

rails awesome nested set show all cats, sub cats, and sub sub cats

Hello, I saw this post http://stackoverflow.com/questions/2059920/ruby-on-rails-awesome-nested-set-plugin but I am wondering how to do the same thing without using node? I am also wondering what exactly this node is doing in the code itself. In my categories view folder i have _category.html.erb and a _full_categores_list.html.erb. ...

Rails: Validate that a link won't create a 404 error

So I have a web app where both users and non-users can submit links to content. My web app is a site where users receive donations to content so I make sure that users verify that they are the owner of a website before receiving donations. So when users submit a link from their own site they get a form with a select field of all the sit...

Heroku deployment error

In a windows environment I am getting the following error when trying to deploy to Heroku C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/base.rb:32:in ': No such file or directory - git remote (Errno::ENOENT) from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/ba se.rb:32:in shell' ...

Rails 404 error for Stylesheet or JavaScript files

Rails can't load (404 error) CSS & JS files on production but has no problem loading them in development. I'm using Capistrano for deployment and running Rails 3. My path on development is /www/myapp but my path on production is /www/myapp/current. The application itself seems to work fine, so the issue seems to be isolated to CSS/JS f...