i just stumbled across a posing on the mongodb-user list where there was a discussion about passenger and forking when using mongoDB with MongoMapper.
I just wanted to remind that Rails developers need to tweak their
'environment.rb' if they use MongoDB with Passenger.
By default, Passenger spawns Ruby processes with fork(). A...
I am trying to find certain functions in the Rails api docs. For example, in the console I can type in:
ActiveRecord::Base.connection.tables
ActiveRecord::Base.connection.indexes("sometable")
and get a list of tables back and a list of indexes. I look in the Rails api doc
http://api.rubyonrails.org/classes/ActiveRecord/Base.h...
I'm trying to write a sh script to make a rails apps, however due to different conflict, I need to modify my environment.rb file to comment out the rails version. So my question is how do I had '#' to line 8 of environment.rb?
...
Hi this is my second post (and second week programming, ever) so apologies in advance.
I have a list of checkboxes that represent different search filters that I want passed to params. For example, if this were a restaurant search, I would want my users to be able to check off different types of cuisine that they are interested in. Ju...
Hello!
I have this Rails app that can be spawned (by Passenger) a number of times. I want to generate a random id for each instance and include it in every view (as a comment on the HTML output), and be able to access a specific instance using the id.
Is this possible with Passenger? Can I target a specific instance? I want to be able ...
Hello, I have a site, say, example.com, which is PHP. I am converting it to Rails, but there are three years worth of issues (like magazine issues) that I don't want to update. Thankfully, it seems that I chose an advantageous url format, ie. all issues start with two digits, then the name of the file in most cases
example.com/00/aut...
I'm trying to connect my Ruby on Rails application to a legacy Database that is in a Microsoft SQL Server 2008. I have looked around different tutorials, pages, help pages, and question pages and still haven't been able to make it work.
I'm using:
Ubuntu karmic
Rails 2.3.5
Ruby 1.8.7
activerecord-odbc-adapter 2.0
activerecord-sqlserve...
Now before I dive too far into this this question, I am aware of nDjango and MonoRail; however, those project seem to be lacking.
What I'm wondering is if there is a solution out in the .Net world that has the following features out of a single box like Rails has in Ruby or Django has for Python. I know tools that do pieces but am curi...
I hope this is a simple - and perhaps embarrassingly dumb - question.
I have the following code that is generating fields for an invoice
THis is in the edit.html.erb for the invoice class
<% f.fields_for(:invoice_items) do |f| %>
<%= render :partial => 'invoice_items/fields', :locals => {:f => f} %>
<% end %>
and I generate the...
My app/views/layouts folder looks like this:
application.html.erb
user_sessions.html.erb
errors.html.erb
These work fine and i have no problems with them but id now like to add a new layout for tips, but only on the index and show actions.
Would "tips.index.html.erb" work?
...
I'm getting a segfault in nokogiri (1.4.1) run (under cucumber 0.6.1/webrat 0.7.0/rspec 1.3.x)
response.should have_selector("div", :class => "fieldWithErrors")
and the div in the page is actually
<div class="fieldWithErrors validation_error"> stuff </div>
Everything runs fine if I just test nokogiri against a test document
>> req...
I have a database the have orders, and which order many order items, that kinds of thing. I deleted one product carelessly, and it is related to the order items, so it can't load successfully. So, I use the SQLite Database Browser to delete the orders and order items. But after I restart the server, it prompt me that :
We're sorry, ...
I once found a slick looking car make/model dropdown menu web service that advertised form helpers for Ruby on Rails, have subsequently been unable to find this again by Googling for it.... Anybody know the service I am talking about?
...
I'm working with an external framework (redmine) which has one Project model that has_many EnabledModules.
Projects can have EnabledModules "attached" or "removed" via the module names, like this:
class Project < ActiveRecord::Base
...
has_many :enabled_modules, :dependent => :delete_all
...
def enabled_module_names=(module_nam...
Hi,
Is there any possibility to extract globalize2 translation for specified locale without setting
I18n.locale = :ru
as i know - i can extract ALL translations using
model.translations
but maybe there are simplest way to extract only for one language?
...
I have nested attributes for a Rails model and the associations validations are failing for some reason. I am not useing accepts_nested_attributes_for, but I am doing something very similar.
class Project < ActiveRecord::Base
has_many :project_attributes
def name
project_attributes.find_by_name("name")
end
def name=(val)
...
When user is logged in we store its user id in the session.
session[:user_id] = user.id
now on all other links in our site, we want the user redirected if session[:user_id] == nil
The way I think it would be done is that it will be done in each of the methods of controller.
def show_customers
if session[:user_id] == nil
red...
Hi,
I've nearly finished rewriting (with some new features) my Symfony (left a bit bad taste in mounth) application into Rails. There is some amount of data which I need to import from my old application into the new Rails app.
Problem is that schema was dramatically changed and some foreign key values should be updated.
I am wonder...
Here's my simple ideal case scenario for when I'd like delayed job to run:
When the first application server (whether through mongrel or passenger) starts, it'll start my delayed job workers.
When the last running application server terminates, it'll kill all the delayed job workers.
The first part (starting) is doable, although I'm ...
Hi there,
I'd like to 'add on' some code on a model's method via a module, when it is included. I think I should use alias_method_chain, but I don't know how to use it, since my 'aliased method' is one of those methods ending on the '=' sign:
class MyModel < ActiveRecord::Base
def foo=(value)
... do stuff with value
end
end
...