So this happens to me regularly, where i have gems that are installed but for some reason my rails app is not finding it...here is my example
my config/environment.rb
config.gem "whenever"
my install
sudo gem install whenever
Password:
Successfully installed whenever-0.6.2
1 gem installed
gem list | grep when
whenever (0.6.2)
scr...
I'm starting to build a script for a Penny Auction site like swoopo.com
What framework should I use?
Whats the best way to keep the timers updated without using too much bandwidth?
This all started when I started looking at all the junk thats currently out there.
Most are using PHP and javascript and I feel there is a much better solut...
Hi,
I have the following model:
class Advisor < ActiveRecord::Base
belongs_to :course
end
class Course < ActiveRecord::Base
has_many :advisors
has_many :sessions
has_many :materials, :through=>:sessions
end
class Session < ActiveRecord::Base
belongs_to :course
has_many :materials
end
class Material < ActiveRecord::Base
...
My code:
<%= button_to 'Login', {:type => 'submit', :class => 'submit'} , {}%>
I want to end up with this:
<input type='submit' value='submit' class=submit/>
but what I'm getting is:
<input type=submit value=submit/>
how to set the class?
...
I have an action named 'login' that shows the login form.
The form posts to the 'signin' action.
I haven't implemented the authentication logic yet, so I tried this:
def signin
redirect_to login
end
So when the login form posts, it just redirects back to the login page again.
Cannot redirect to nil!
but its not working, wh...
I'm running Rails 2.3.2 on Ubuntu with passenger. In /config/environment.rb, I've set
ENV['RAILS_ENV'] ||= development
In the Apache config file, I've set
<VirtualHost *:80>
ServerName localhost
DocumentRoot /root/webapps/myapp/public
RailsEnv development
<Directory /root/webapps/myapp/public>
AllowOverride all
Option...
How my rails app can handle the incoming headers of a request like:
curl -v -H 'X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json' -H 'X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/",
oauth_consumer_key="yTrEIQH6jhtmLUypg8T5", oauth_signature_method="HMAC-SHA1",
oauth_to...
Hi there,
I have a rake task that I created to populate my database with fake data. One of my models has a before_validation callback method which uses the blank? method. When I run my rake task, the task is aborted with the following message:
rake aborted!
undefined method `blank' for #<BigDecimal:101848c10,'0.35E2',9(18)>
...
I have a rails 3 application on localhost, but my host (dreamhost) uses 2.3.5.
Are there any techniques to downgrade my application?
I've tried installing rails 3 locally, but there is a conflict with rake. And simply trying to run my application results in an "uninitialized constant Bundler" error.
I'd rather not re-write it from sc...
I have a rather misterious problem dealing with booleans in Rails, here is how to reproduce:
rails new boolean_bug
rails generate model User verified:boolean
With this you should have an empty project with the User model.
3 Inside boolean_bug/app/models/user.rb
'
class User < ActiveRecord::Base
before_save :set_false
attr_access...
When you use OmniAuth to login to a web app through Facebook, these are the permissions the webapp has:
Access my basic information Includes name, profile picture, gender, networks, user ID, list of friends, and any other information I've shared with everyone.
Send me email WebApp may email me directly at [email protected]
Access my da...
I have the following models with associations as given below:-
class Comment < ActiveRecord::Base
belongs_to :post
belongs_to :user
end
class Post < ActiveRecord::Base
belongs_to :user
has_many :comments
end
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable,...
Hi! Want to set up mysql master-slave replications in rails app.
Are there plugins/db adapters available for Rails 3? Does the Masochism plugin work properly with rails 3?
...
I was previously using Ruby 1.8.7 & Rails 2.3.5 on Heroku.
I upgraded my development environment to Ruby 1.9.2 and Rails 3.0.1 using the instructions this railscast. RVM is used, so the system versions of Ruby and Rails are still 1.8.7 & Rails 2.3.5 respectively, but I have an RVM environment with 1.9.2 and 3.0.1, which I now use.
I'm...
I have a controller which has a lot of options being sent to it via a form and I'm wondering how best to separate them out as they are not all being used simultaneously. Ie sometimes no, tags, sometimes no price specified. For prices I have a default price set so I can work around with it always being there, but the tags either need to...
Here are my smtp settings for Google Apps in setup_mail.rb.
:address => "smtp.gmail.com",
:port => 587,
:domain => 'mysite.co',
:user_name => '[email protected]',
:password => 'password',
:authentication => 'plain', ...
I'm using this code (taken from here) in ApplicationController to detect iPhone, iPod Touch and iPad requests:
before_filter :detect_mobile_request, :detect_tablet_request
protected
def detect_mobile_request
request.format = :mobile if mobile_request?
end
def mobile_request?
#request.subdomains.first == 'm'
request.user_agent ...
Hello All,
I am new to Rails and I am trying to use omniauth with rails 2.3.8. I
couldn't find any tutorial for this version of rails so I referred to
http://blog.railsrumble.com/blog/2010/10/08/intridea-omniauth.
I added the initializer as follows:
omniauth.rb
OmniAuth::Strategies::Twitter = {
:consumer_key => 'xxxxxx',
...
Dear all.
I'm using heroku to deploy my app (rails 3). Ok so I do the usual, which is a git commit, a git push heroku master => deployment is ok, gems are installed, etc...
When running my app in the web browser, I get an heroku error : app crashed.
In the ouput of heroku logs, this got my attention :
==> dyno-2625316.log (crash) <==
...
From within an action (not the view), I want to output some quick debug code.
Does rails have a method for this?
in asp.net I would do:
Response.Write("hello");
...