I'm looking to disable (or customized) tab completion in emacs Ruby on Rails mode, specifically code completion. The fact that tab completion overrides using tab for indenting plus the fact that tab completion tries to complete lines like "end" is fairly infuriating.
Thanks
...
I'm trying to do a many-to-many relationship in rails. It's my first try but I'm having a hard time to succeed. I want to be able to do @user.properties or @property.users.
#property.rb
has_many :ownages, :dependent => :destroy
has_many :users, :through => :ownages
#user.rb
has_many :ownages, :dependent => :destroy
has_many :properties...
Is there a better way to write this
I have A Condition which previous Look Very clean and easy to understand
like
Account.first.websites.last.users.find(:all,
:conditions => {:country => "XYZ",:status => "Single",:admin => nil)
Now the big problem is that user with admin = false is not picked up.
i.e I want all the user...
Ive built a small application which interacts with mysql at the backend.When I run on the mongrel server its wrking fine.
I want to run this application on apache server.
The application is a rails application
OS is opensolaris
I tried to modify the httpd.conf in apache and added the follwing lines to it.
LoadModule passenger_module /va...
I'm developing the web site using Aptana 2.04.
When i say "script/server" from the project folder, everything is ok
After copying the project folder to another place, and saying "script/server", server starts, but jammit does't loads the packaged assets and i see the web page without any css and js files loaded.
I played a little with...
I have latest clone for rails source code.
I want to create apps with the help of rails latest commit. I am not going to use those apps in production. Just for experimentation.
How do I do it ?
...
I have a DSL for controller configuration. The underlying functionality relies on before_filters. To prevent setting the before_filter more than once, I really need to find out whether a before_filter is already set in a Rails 3 controller. Since before_filter work different from class variables (inheritance, class reloading), I cannot...
I thought it was possible to create a new model object through an association?
class Order < ActiveRecord::Base
belongs_to :basket
end
class Basket < ActiveRecord::Base
has_one :order
end
order = Order.new()
basket = order.basket.new() # NoMethodError: undefined method `new' for nil:NilClass
...
I have a form, and for layout (and future use), i would like to know how to change the default f.submit that generates a:
To a html tag that shouldn't give any errors.
What i have now is an extention on the formbuilder
In my view:
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :class => "for...
How to integrate ccavenue(Payment gateway) with rails application?
is there any gem or plugin available?
...
Hi,
I'm testing a method with quite huge sql query. I has about 15 joins, one subquery with 2 joins, so it is complex. But each running takes different time. Once it is 4 second, sometimes 80, or even 200 seconds. It is standard unit test, with preparing data with FactoryGirl, and data is always the same.
Is there any mysql profilers, m...
I have a Ruby on Rails application that has two active environments, Stage and Production. Our development team has been using Stage, but we would like to move our data onto the production server for various reasons. However, there are conflicting ID's in the new database, so it's not as simple as pulling the data from one location and...
Hello guys,
I have an existing Rails App with considerable js code written using Prototype, I would like to make jQuery the default app's javascript framework and then migrate the existing Prototype code the jQuery's equivalent.
What is your experience with this kind of issues or what strategies you suggest me in order to make this a...
I fired up irb, and typed:
class Point
end
and then I typed that again, but added some other things.
Irb didn't complain that I was defining a class that already exists.
...
Given the following url:
http://example.com?arr[]=hello&arr[]=to&arr[]=you
Am I able to bank on the fact that:
params[:arr] == ['hello', 'to', 'you']
?
I ask because I have some additional data that will be sent with the request that needs to be mapped to each of the values in params[:arr].
...
I want to have an admin area.
So I wrote:
map.namespace "admin" do |admin|
admin.resources :cities
admin.resources :links
end
But I would like to the admin area for a specific location.
I am looking for something like:
map.namespace "admin/:location_id" do |admin|
admin.resources :cities
admin.resources :links
end
what wo...
I am trying to setup searchlogic on nested resources. I have Category has_many :products also Category has_many :brands through :products
So structurally its Category/Brand/Product
As a user navigates the site they click a category, which uses the Category#show action.
#Category_controller
def show
@category = Category.find_by_u...
Hi,
I have the following User model:
class User < ActiveRecord::Base
has_many :competences
has_many :skills, :through => :competences
accepts_nested_attributes_for :skills
end
and the following Skill model:
class Skill < ActiveRecord::Base
has_many :competences
has_many :users, :through => :competences
end
The Competenc...
I'm guessing that rails stores all the parsed translations yml files in a sort of array/hash.
Is there a way to access this?
For example, if I've a file:
en:
test_string: "testing this"
warning: "This is just an example
Could I do something like, I18n.translations_store[:en][:test_string] ?
I could parse the yml file with YAML::l...
How would i do the following.
My current code is :
<%= f.label :email, html_escape("<span class=\"big\">Test</span>") %>
This doesn't shows what i want, because the
<span class=\"big\">Test</span>
is shown as text instead of HTML.
I have been thinking of overriding the FormBuilder, but i don't know how i would do this and sea...