Hi, I'm trying to install a rails server for my application. I'm using ubuntu 10.04 TLS with apache2 as web server. I made some search on google but I do not found something that help me. When I tried to connect on my application I have following error:
The application has exited during startup (i.e. during the evaluation of config/envi...
Greets to ruby developers.
I'm stuck with ActiveRecord model associations.
I illustrate what I want to do by a tables. I have these tables:
Products:
+----+-----------+
| id | name |
+----+-----------+
| 1 | Cellphone |
+----+-----------+
Images:
+----+-------+--------------+----------------+
| id | url | imageable_id | image...
Hi, in my view I usually do something like this
<%= render :partial => "shared/p" %>
and _p.html.erb file is places into myapp/app/view/shared/_p.hrml.erb.
Let's suppose I want to place this file in a cutomem folder like myapp/custom/_p.html.erb how can I load the folder custom into my app?
...
Let's say you have some products which have 2 fields, a description and a stock value.
How do you layout a form of all the products in an action named mass_edit with fields so a user can edit some, press submit and then save them in a mass_update?
I have used nested forms in a order-order_line scenario but i can't seem to figure this o...
Hello,
I currently use the script below to back-up a website but it could be improved dramatically! Please could you suggest any improvements, or perhaps alternative solutions?
Currently, I only delete items after a massive amount has been reached - and this is not good. Does anyone know how I can delete items that are a month old, o...
Hey,
I have a Rails application that lately is behaving very weird. If I start the server, I can do one successful request, but the next one ends with a failure (exactly the same request). This is not true for all pages, but for most with dynamic contents. When the failure occurs, I get this error:
Processing StartpageController#index ...
We are using the devise gem for authentication in a Rails 3 application. We have multiple roles and from the devise stand-point, the roles will differ in terms of confirmation, activation and remember me functionality.
The devise documentation has examples of two scopes being defined. One is the User itself and the other one is the admi...
I would like to upgrade my 2.3.5 apps to 3.0.
But i want to be careful in doing it. what are the places where i cannot rely on backwards compatibility.
How do i upgrade in one step if possible?
Edit: Thanks anand for the link... I also have another doubt... Is it advisable to upgrade applications that are live?
Is the 3.0 beta stabl...
Hi!
I defined function in application helper:
def display_standard_table(columns, collection = {})
content_tag :table do
concat content_tag :thead do
content_tag :tr do
concat columns.collect { |column| content_tag(:td, column[:display_name]) }
end
end
concat content_tag :tbody do
...
I'm adding tags to several models (Posts, Articles, Photos, etc). I'm aware of rails tagging plugins but prefer not to use them, as they don't quite meet my specific needs.
I know the typical way of implementing polymorphic tagging support is to use 2 tables Tags, Taggings and setup the appropriate has_many :through relationships.
B...
I have three models each having the following associations
class Model1 < ActiveRecord::Base
has_many :model2s
has_many :model3s
end
class Model2 < ActiveRecord::Base
belongs_to :model1
has_many :model3s, :through => :model1 #will this work... is there any way around this
end
class Model3 < ActiveRecord::Base
belongs_to :model1
has_m...
I am storing user generated html code in the database, but some of the codes are broken (without end tags), so when this code will mess up the whole render of the page.
How could I prevent this sort of behaviour with ruby on rails.
Thanks
...
I would like to create a Rake task that:
checks a column in a table row
and if its value is false, sends an email with the row information,
and then change the value from false to true.
Does anyone know the best way to approach this?
...
Lots of confusion and difficulty related to gem installation. My gem environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/local/bin/ruby
- EXECUTABLE DIRECTORY: /opt/local/bin...
Hi,
I am trying to integrate my rails app with Resque plugin but in the doc it is not given that where should I write the code and how to use that code when running application. May be it is not understandable for me.
It would be helpful for me if any one explain it with an example application.
Thanks in advance.
...
I have the following models set up:
class Player < ActiveRecord::Base
has_many :game_players
has_many :games, :through => :game_players
end
class Game < ActiveRecord::Base
has_many :game_players
has_many :players, :through => :game_players
end
class GamePlayer < ActiveRecord::Base
belongs_to :game
belongs_to :player
end
...
Have you guys ever saved your information with binary masks to improve performance? This is my case and I am also using mongodb with rails to store and retrieve it.
I've used a pair of scopes using '&' and '|' to retrieve users with specific roles, but each time I run those scopes I get all the users regardless the roles... how could I ...
Controller ClientDocument.
def upload_document
ClientDocument.upload_client_document(params)
end
Model ClientDocument.
Class method..
def self.upload_client_document(params)
self.new :uploaded_data => params[:Filedata],:client_id => params[:client_id]
rename_document_name(params) # Call instance method
end
Instance method..
...
Here, I have probleming in trim the value in postgresql. Please have a look. Ruby code ::
if(this.modelName=="ClientOffice")
{ this.params="model_name="+this.modelName+"&action_name="+this.actionName+"&
find_condition=btrim(clients_corporate_billings.id,' ') %3D
btrim('"+validString('populateValue0','text')+"',' ')
& ob...
I've my rails app using authlogic for user session, I'm building an iphone-app as client of this site, how can I do with the login\logout\session management?
I know that's a common question but I've tried to look for it everywhere but I can't find anything clear and useful
thanks
...