OCIError (ORA-12541: TNS:no listener):
oci8.c:270:in oci8lib.so
/usr/local/ruby-1.8.7-p248/lib/ruby/gems/1.8/gems/activerecord-oracle_enhanced-adapter-1.2.4/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:223:in `new'
/usr/local/ruby-1.8.7-p248/lib/ruby/gems/1.8/gems/activerecord-oracle_enhanced-adapte...
I can't seem to figure out how to do this. I am trying to pass four different variables to a single table. To be more specific I am trying to create a "like" in a likes table that also captures the site_id (like an answer), user_id, and the question_id. Here is the set up.
class Like < ActiveRecord::Base
belongs_to :site
belongs_to ...
I have a Rails app handling authentication with the restful_authentication plugin.
I'm experiencing problems with the email activation feature and before I deal with that I would like to just allow my users to register without having to go through the email activation process.
How do I disable the email activation feature.
Rails 2.2.3...
Here I've got two controller methods:
def invite
if request.post?
begin
email = AccountMailer.create_invite(@user,url)
AccountMailer.deliver(email)
flash[:notice] = "Invitation email sent to #{@user.email}"
rescue
#mail delivery failed
flash[:error] = "Failed to deliver invitati...
Where can I find a complete example of ActiveMerchant Integrations usage? I can see tons of examples of Gateways' usage, but couldn't see how an Integration should be used (e.g. what do you do in the return_url and cancel_return_url controller actions?)
...
Hi,
I'm trying to migrate my app from MySql to Postgresql, using Rails3-pre and the latest DataMapper.
I have several models which are related through many-to-many relationships using :through => Resource, which means that DataMapper creates a join table with foreign keys for both models. I can't auto_migrate! these changes, because I...
I'm trying to setup log rotation in rails. I have put this in my environment/development.rb:
config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 1, 5*1048576)
2 files are created :-) but it looks like rails is writing to them randomly and at the same time as well. This creates messy log files :-( what am I missing?
...
I am making a Viewer model with
belongs_to :users
belongs_to :orders
that joins the models Users and Orders with a :has_many :through => :viewers.
And the Viewer model has the attributes of user_id and order_id.
How would I set it up so that new viewers are only accepted if both user_id and order_id are unique in the same row? I re...
Hi @all,
i'm having a no route matches error after a render :partial
<% unless @user.uploads.empty? %>
<% @user.uploads.each do |u| %>
<tr>
<td><%= link_to u.filename, u.filename %></td>
it gives me the right filename like http://localhost:3000/DSC00082.JPG.
i haven't added anything to my routes.
for being new to rails, please excu...
Hi -
I have a class located inside RAILS_ROOT/lib folder, which I use in one of my helpers, and it works great in development.
When I switch to production, the application throws a NameError (uninitialized constant SomeHelper::SomeClass), and I have to load it manually in the helper:
load "#{Rails.root}/lib/some_class.rb"
module So...
I have a User object, that is related to a Post object via two different association paths:
Post --(has_many)--> comments --(belongs to)--> writer (of type User)
Post --(belongs to)--> writer (of type User)
Say the following hold:
user1.name == "Bill"
post1.comments[1].writer == user1
post1.writer == user1
Now when I retrieve the ...
Hi...I am getting the following warning while installing any plugin in my rails application.
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/agnostics.rb:7: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Can someone please tell me how to solve this problem?
Thanks
...
I have the following configuration:
uname -a : Linux 2.6.24.2 i686 GNU/Linux (Ubuntu)
ruby -v : ruby 1.9.0 (2007-12-25 revision 14709) [i486-linux]
rails -v : Rails 3.0.0.beta3
gem -v : 1.3.5
rake --version : rake, version 0.8.7
make -v : GNU Make 3.81
gem env :
RUBYGEMS VERSION: 1.3.5
RUBY VERSION: 1.9.0 (2007-12-25 patchlevel 0) [i4...
WOW. Setting up is complicated, can anyone recommend a link or provide me with some advice.
I have two options, a Linux Hosting server with it pre-installed or through NetBeans.
Sorry for the generic question.
...
I have been a .NET developer for the last 7 years. Now I want to move to a Ruby on Rails stack.
Also, I don't have any experience with Linux.
Anybody else who made the same move? Any suggestions? Good books?
I am having some idea about ASP.NET MVC
...
Hi,
I started using YSlow and I noticed that I haven`t got expire headers on my static files. So I did a little research what is that and how to add it and tried to turn it on from the .htaccess file. But the problem is that when I put the code in the file apache returns me a 500 error. And I started thinking that the problem is from Rai...
I run the server, it works, i refresh the page with no edit and i get: undefined method `new' for Smodules::Grid:Module.
why?? i dont get it! so nervous
...
I have a transaction in one of my model. When something go wrong, I want to be notified.
If it would be transaction in controller, I would simply do:
begin
(my transaction...)
rescue => exception
ExceptionNotifier.deliver_exception_notification(exception, self, request, data)
end
But I want to do similar thing in my model, passin...
Using Rails 3: In my update.js.erb file I found I was repeating a lot of stuff. So I tried to put it all into a helper. But I'm having trouble getting the helper to give back clean javascript. It puts in \" everywhere instead of "
Here's what I started with:
<% if @list.show_today %>
$("#show_today_check_<%= @list.id %>").rem...
I'm iterating over records and want to create the toggle-options for records but I can't replace the div-id with the records:
<% for bill in @bills %>
<% tmp = "test"%>
<%= link_to '» now','#', :onclick => '$("#{tmp}").toggle();' %>
Instead of getting:
<a href="#" onclick="$("#test");">» now</a>
I'm getting:
<a...