hello,
I am getting this error in rails whenever i am trying to create an object for the model. I am working on Windows 7
C:\Ruby\joker\chapter3>ruby script/console
Loading development environment (Rails 2.3.8)
>> mycb = ComicBook.new
SyntaxError: C:/Ruby/joker/chapter3/app/models/comic_book.rb:19: syntax error, u
nexpected $end, expec...
In my java days I used to configure the logger so that different classes had different levels i.e.
Person.logger.level = :debug
Address.logger.level = :error
I haven't been able to find a way to do this with the ruby logger. Perhaps I need to create a separate logger for each class?
...
I've been learning Ruby on Rails whilst making my first app for a couple of months now, and it's finally ready to start to be used by a few unlucky friends as beta testers. Problem is, I have no idea as to how to move from development to production. The app is on Heroku, and up to this point I've just been pushing the local development d...
I'm writing a ruby on rails service that will conect to various servers via SSH.
I want to generate the public/rivate key and store them in the database. Then the user will be able to view the public key and add it to there key authentication for SSH on their server.
The my service will contact the servers via Net::SSH and present the ...
Hi,
I am not able to create database columns when i use t.string or t.number.
When i did rake db:migrate i got this
C:\Ruby\joker\chapter3>rake db:migrate
(in C:/Ruby/joker/chapter3)
== CreateComicBooks: migrating ===============================================
-- create_table(:comic_books)
-> 0.0630s
== CreateComicBooks: migrate...
hii all,
Am running apche as frontend to mongrel ,i added these line in Apache's httpd.conf file
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule xse...
I have a collection_select field, and I want to make a div visible or invisible after changing it, depending on the new value.
I have the below code for the collection_select field, there is a JS function change_div_visibility which currently accepts a div name but I also want to pass in the collection_select value.
How can I also se...
I am new to Rails / Ruby. I am working on a project where we want to capture snapshots/revisions of the objects when certain operations happen. Its similar to the how the revision control works for the Writeboards in basecamp. Is there any gem which will automate this functionality or some open source project in RoR which we can use as a...
I am making a photo upload form. Before they begin, they have two choices. They can create a new gallery, OR they can choose from an existing gallery.
I was thinking the best way to lay this out would be two have two forms. One for the create one that would take them to the create page. That's easy, and practically done.
But the second...
I just created a simple migration to an existing project. This project uses RMagick, and when I call rake db:migrate the migration fails thus:
Dans-iMac-335:myserver apple$ rake db:migrate
(in /Users/apple/Documents/projects/electionjoy/glowing-mist-78)
dlopen(/Users/apple/.gem/ruby/1.8/gems/rmagick-2.12.1/lib/RMagick2.bundle, 9): Libra...
I've recently been working with our passenger setup and monitoring our app via NewRelic's RPM. As of the last week I've noticed that the production version of our app restarts about once an hour (doesn't track to exactly once an hour, it's seemingly random, and only happens during the day that I can tell - though there are seldom request...
Hi, I want to change my delete not to delete but to update a field on the record called "deleted"
<%= link_to 'Destroy', document, :confirm => 'Are you sure?', :method => :delete %>
Seems like this should work, but it doesnt:
<%= link_to 'Destroy', document, :deleted => true, :confirm => 'Are you sure?', :method => :post %>
...
Is there a list of all RoR helpers used in view pages?
Can these helpers be used in both the view pages and action pages?
...
Say in a action, I want to create points in the code where someone can hook into, without having to go into the controller action and edit my code.
Is this possible? I guess they would have to hook into my code at some point when the application starts?
I know wordpress has a plugin arch with hooks, wondering if the same can be done i...
User should insert all the values either positive or negative.
How may i set same sign validation ?
Right i have written this on before_save ..
unless (self.alt_1 >= 0 && self.alt_2 >=0 && self.alt_3 >= 0 &&
self.alt_4 >= 0 && self.alt_5 >= 0 && self.alt_6 >= 0) ||
(self.alt_1 <= 0 && self.alt_2 <=0 && self.alt_3 <= 0 &&
...
This is a high-level question about web frameworks, that as a desktop app developer, I don't have much knowledge of.
I am planning to build a web application which visualizes some data stored in a database. I plan on using Rails for user query. For visualization, the Raphael JS library looks good. Would it be a considerable task trying...
Not sure why this is not working...
I have a collection_set as below
<%= collection_select(:entry, :entry_status_id, EntStatus.find_all_draft_or_edit, :status, :en_desc, {}, { :onchange => "change_editor_select_visibility('entry_set_editor', this.value)" }) %>
When I load the form, I want to set visibility on another div based on the...
I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the config/routes.rb defines the following
resources :users
match '/:controller(/:action(/:id))'
When I do a rake routes from the application that requires this gem I get the following routes
rake routes|grep users
users GET /users(...
Hi
I have a controller that I want to refactor. This controller basically renders a formatted XML document.
The controller does 4 main things.
It get records from a DB
It reads a static xml file from rails_root/config
It iterates through DB records and gsubs the XML doc using the DB data
It renders the XML document as :text
My ques...
If an action looks like:
def show
@post = Post.find(params[:id])
end
I can then do:
<%= @post.title %>
How does it pass the object to the view?
Since my action has only one line, what programming technique or pattern is used to take the @post object and pass it to the view (template) page?
I know it assumes the view will be the...