I have an app provided by a vendor an I cant seem to start them on my local mac... I get the following error. Anyone know what I can do to get this thing working.
Apu:app Apu$ script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.2.2 application starting on http://0.0.0.0:3000
=> Call with -d to de...
I'm trying to get a site to validate as HTML5 on the W3C Markup Validator. When I use the "Validate by URI" option, it generates a ton of errors, but when I copy and paste the HTML into the "Validate by direct input", it validates perfectly. When I run a diff on the two sources returned by the validator, the only differences are the Rail...
I am adding a directory for services classes in my rails application: app/services
I would like to add specs for these classes in the directory: spec/services
I added a spec to spec/services, but running autospec does not run the example.
Is there a way to configure autospec to run examples in new directories?
Thanks.
...
Currently, I am working on building RESTful web service in Rails. I am looking for some ways to build a good documentation in my Rails RESTful web service. I found some ways to do it:
Wiki like Twitter API
RDoc
WADL (I'm not sure if anyone is currently using it?)
Could anyone gives any recommendations?
...
This is probably a stupid question but I'll go ahead and humble myself.
The Ruby code in my controllers and models are interpreted so that a HTML result is sent to the browser. Ok, I get that part.
But is there any way for a mailicious user to somehow take a peek at the Ruby code in the controllers and models by bypassing the process ...
I'm building something akin to Google Analytics and currently I'm doing real time database updates. Here's the workflow for my app:
User makes a RESTful API request
I find a record in a database, return it as JSON
I record the request counter for the user in the database (i.e. if I user makes 2
API calls, I increment the request count...
Hi
I am new to rails and need some guidance. I am sure I am misunderstanding something obvious.
I would like the user name of the person who leaves a comment to show on the view page. I have a partial that goes through the collection of comments for the particular object for example a school. I can't figure out how to pass that user va...
It is well and good that the server restarts automatically for each change in the code. How would you have even the browser refresh automatically, as per configuration (Turn on and off, the least).
How to do it on Windows, and on Linux, for all different development frameworks.
What existing packages allow you to do it, and if you are ...
For some reason when I try to do config.gem include for this particular gem package it always says its missing. I tried gem 'xapian-fu' and that works just fine! I am sure its not multi gem repository issue as I use the environment in regular basis and has no problem about this.
...
I have created a form that needs to show data from 2 tables (parent and child). When the form is submitted only the child fields are updated (the parent fields are meant to be display only). While the parent model fields are displayed these need to be protected from updates (preferably via the formbuilder, rather than via css).
FWIW th...
How do I "log out" a user? Know that this is not officially supported, but I need a quick and dirty hack. Saw somewhere I just throw out a 401 access denied - but anyone know the syntax
...
I need to be able to create a UserSession without having the decrypted password.
How do I go about doing this?
My current workaround is:
In user.rb
def valid_crypted_or_non_crypted_password?(password)
valid_password?(password) || password == crypted_password
end
In user_session.rb
verify_password_method :valid_crypted_or_no...
Given the following ActiveRecord models:
class Tree < ActiveRecord::Base
# attributes: title, price, some_date
has_many :nodes
end
class Node < ActiveRecord::Base
# attributes: title, price, some_date
belongs_to :tree
end
A Tree has many nodes (1'000 - 2'000).
For performance and other reasons I'd like to cache the price attr...
It is the first time I use Capistrano and the application had been already published without it. When I type cap deploy:migrations I get the following error after some successful commands:
* executing "cd /home/collimarco/foto-fiori.com/releases/20090818111104; rake RAILS_ENV=production db:migrate"
servers: ["foto-fiori.com"]
...
I wonder if there's a plugin to enable a sort of smart truncation. I need to truncate my text with a precision of a word or of a sentence.
For example:
Post.my_message.smart_truncate(
"Once upon a time in a world far far away. And they found that many people
were sleeping better.", :sentences => 1)
# => Once upon a time in a w...
I'm currently building a "Lifesteam" style website in Rails. A lifestream usually is an aggregate of public content (usually received via APIs).
I'm currently confused about the database structure.
There will be a Users table (as users will be able to sign up and have their own lifestream). I'm wondering whether I should also have a S...
It seems ridiculous (and a violation of DRY) to have to type the h method all over the place in your view code to make it safe.
Has anyone come up with a clever workaround for this?
...
I have been using attachment_fu on a project for a long time and all was fine but now as I am trying to bring the project up to rails 2.3.3 I am running into a strange bug that is driving me nuts. The Attachment, a logo in this case, validates correctly on create but does not fail validation on update. I have debugged it and it fails the...
I can run the following commands in the console for my Rails application and import CSV file into my database.
require 'csv'
# row will be an array with the fields in the order they appear in the file
CSV.open('myfile.csv', 'r') do |row|
# assuming the fields in the CSV file are in order npa, nxxFrom, nxxTo, trnk
# create and s...
I'm following this tutorial I'm focusing on the testing portion.
I'm trying to test the following snippet:
def test_disallowed_passwords
u = User.new
...{some more testing code}
assert !u.save <<<<<<This is line 27
The
u. save
should fail in this case.
When I run the test, I get the following:
...