Hello all,
I'm working with a rails app which plays mp3s. Is there a way to catch the request for the mp3 file with ruby, reformat the request(url), and pass the request along?
I'm really just trying to protect the urls...
...
Hello,
I tried to run
ruby script/server RAILS_ENV=production
but somehow it always try to read "development" config.. nothings wrong with RAKE XXX RAILS_ENV=production (trying to read production config).
Any idea how to troubleshoot?
I have my other rails app in the same machine and it works fine. The problem above only happen fo...
Hello. I got a 500 Internal Sever error when I try to deploy my rails app on heroku. It works fine on my local machine, so i'm not sure what's wrong here. Seems to be something with the "sessions" on the home controller. Here is my log:
==> production.log <==
# Logfile created on Sun May 09 17:35:59 -0700 2010
Processing HomeContro...
I am trying to set up a blog using Enki. There is a config file here: http://github.com/xaviershay/enki/blob/master/config/enki.yml
Which I don't understand. I signed up for myopenID and replaced my username in the delegate, but I don't understand what goes under "open_id" - is it just my URL? I'm just not sure what's going on, or what ...
I am trying to scrape this page: http://www.udel.edu/dining/menus/russell.html. I have written a scraper in Ruby using the Hpricot library.
problem: HTML page is escaped and I need to display it unescaped
example: "M&M" should be "M&M"
example: "Entrée" should be "Vegetarian Entrée"
I have tried using the CGI library...
Look at the discussion on this thread . I am not able to follow how having a block to a fetch is a better solution.
...
Is there a built-in function to get the day in last month, same as today? Examples:
2010/05/02 -> 2010/04/02
2010/05/15 -> 2010/04/15
2010/05/31 -> 2010/04/30
Thanks!
...
Here's the situation:
I have a User model, and two modules for authentication: Oauth and Openid. Both of them override ActiveRecord#save, and have a fair share of implementation logic.
Given that I can tell when the user is trying to login via Oauth vs. Openid, but that both of them have overridden save, how do "finally" override save...
In Ruby, the operation of
point - 20 # treating it as point - (20,20)
20 - point # treating it as (20,20) - point
are to be implemented.
But the following code:
class Point
attr_accessor :x, :y
def initialize(x,y)
@x, @y = x, y
end
def -(q)
if (q.is_a? Fixnum)
return Point.new(@x - q, @y - q)
end
Poin...
I am trying to make a little application to allow to record actions within a Flash and Silverlight application. In such manner that you can compile your interactive application in test-mode and then be able to click on elements which then passed the action to Selenium IDE which then adds this command to the testcase.
I am curious if thi...
Hi, I'm writing an app that calls ruby code from c. I am having a little difficulty and wondered if anyone could point me in the rite direction.
I currently have in my C.
#include ruby.h
main()
{
ruby_init();
rb_require("myRubyFile");
rb_funcall(rb_module_new(), rb_intern("RubyFunction"), 0, NULL);
}
My ruby file is in the sam...
Hi
I know from vim the % to move to associated ( ), { }, [ ]. How can I do that in textmate?
...
I have been given a project of editing a website which is coded in RoR.
However, the changes which i make in the view file is not visible immediately after a hard refresh but after 15-20 mins, the changes reflect. I am guessing this has something to do with the RoR caching system.
Can someone please help me out ? The changes i made are...
Hey,
I am creating a site in Ruby on Rails, I have two models a User model and a Transaction model.
These models both belong to an account so they both have a field called account_id
I am trying to setup a association between them like so:
class User < ActiveRecord::Base
belongs_to :account
has_many :transactions
end
class Trans...
Am I fundamentally misunderstanding Ruby here? I've been writing Ruby code for about 2 years now and just today stumbled on this...
ruby-1.8.7-p249 > i = true and false
=> false
ruby-1.8.7-p249 > i
=> true
Could somebody explain what's going on here please? I'm sure it's to spec, but it just seems counter intuitive to me...
...
Hey,
I have a Ruby on Rails application setup like so:
User Model
has_and_belongs_to_many :roles
Role Model
has_many :transactions
has_and_belongs_to_many :users
Transaction Model
belongs_to :role
This means that a join table is used called roles_users and it also means that a user can only see the transactions that have been ...
Hello all, I am writing a mobile App involving creating a Blogger client. I have the APIs that I need but the problem is how to write the ruby code for making a post using the texts beeing provided as well as making comments. The texts are supplied via form input but I don't know how to write the ruby code to post the text.
I will be ver...
Here's my index action in the books controller: http://pastebin.com/XdtGRQKV
Here's the view for the action i just mentioned: http://pastebin.com/nQFy400m
Here's the result without being logged in: http://i.imgur.com/rQoiw.jpg
Here's the result when i'm logged in with the user 'admin': http://i.imgur.com/E1CUr.jpg
So the problem is t...
Hi!
I've got model A and model Attach. I'm editing my A form with nested attributes for :attaches. And when I am deleting all attaches from A via accepts_nested_attributes_for how can I get after_update/after_save callbacks for all of my nested models? Problem is that when I am executing callbacks in model A they are executed right AFTE...
I'm trying to layout 6 images per page with prawn in Ruby:
case (idx % 6) # ugly
when 0 : (pdf.start_new_page; pdf.image img, :position => :left, :vposition =>...