I am just trying to get a simple tarantula request working, but finding it difficult without an api.
If I have a simple test like tarantula_crawl(self) I get an error like
1) Error:
test_tarantula(TarantulaTest):
RuntimeError: 9 failures
tarantula (0.3.3) [v] lib/relevance/tarantula/crawler.rb:221:in generate_reports'
tarantula ...
I'm going to have a ton of subclasses, so want to organize them under a subfolder called stream. I added the following line to the environment.rb so that all classes in the subfolder would be loaded:
Rails::Initializer.run do |config|
...
config.load_paths += Dir["#{RAILS_ROOT}/app/models/*"].find_all { |f| File...
So...basically, I want this in my drop down:
•Nothing
•Option 1
•Option 2
•Option 3
Link to another page
Link to another page
I tried throwing a link_to to a select tag... that didnt work...
any ideas?
...
Hi,
i've got a strange behavior or autospec. On autospec run i see in console
/opt/local/bin/ruby /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.7.3/bin/cucumber --profile autotest-all --format rerun --out /var/folders/xx/xxbiSMYpEjesle1hezvfDU+++TI/-Tmp-/autotest-cucumber20100603-46558-rwbmlp-0
Missing these required gems:
cucumber-ra...
Hi... I am sending an Ajax Request using jQuery. What happens is that I am getting an "405 Method Not Allowed" Error. I am just posting a form, which would get the detail from the form and insert it into the DB. Just the usual stuff.I am using WEBrick that comes as default with the rails package. Can somebody please tell me how to fix th...
I'm trying to come up with my own star image that's slightly smaller and different style than the one provided in the gem/plugin, but Ajaxful_rating doesn't have an easy way to do this. Here's what I've figured out so far:
The stars.png in the public folder is three 25x25 pixel tiles stacked vertically, ordered empty star, normal star...
PROBLEM
Hello,
I am having no luck trying to break down this SQL statement into ActiveRecord/Rails friendly code and I'd like to learn how I can avoid a find_by_sql statement in this situation.
Scenario
I have users that create audits when they perform an action. Each audit is of a specific audit_activity. Each audit_activity is wort...
I am attempting to add email capabilities to my app (forgotten password, notifications, etc.) and I am using EngineYard for hosting. I have successfully configured email in my test environment but upon uploading to EY it seems to error out in Production. I don't pay for their support and the only resource is a bit vague (or beyond me).
...
I'm suffering from a variant of the problem described here:
ActiveRecord assigns table aliases for
association joins fairly
unpredictably. The first association
to a given table keeps the table
name. Further joins with associations
to that table use aliases including
the association names in the path...
but it is comm...
I've got a simple list page with a couple of search filters status which is a simple enumeration and a test query which I want to compare against both the title and description field of my model.
In my controller, I want to do something like this:
def index
conditions = {}
conditions[:status] = params[:status] if params[:status] an...
I want to fetch posts based on their status, so I have this code inside my PostsController index action. It seems to be cluttering the index action, though, and I'm not sure it belongs here.
How could I make it more concise and where would I move it in my application so it doesn't clutter up my index action (if that is the correct thing...
So rails appends timestamps to CSS, JS and image files:
image_tag 'foo.png' =>
<img src="foo.png?123123123123' /> # or somethin like that
...which is really useful for doing far-future expiration, etc. with Apache's help.
But what about images referenced from stylesheets? They don't get an appended timestamp. So it seems to me tha...
Hi,
I'm having trouble getting JSON data from my Rails app to display on a Google Map using jQuery. In my controller:
class PlacesController < ApplicationController
respond_to :html, :xml, :json
# GET /places
# GET /places.xml
# GET /places.json
def index
@places = Place.all
respond_to do |format|
format.html...
f.input :some_model_values, :as => :select
Using Formtastic, I need to set a text for options on my select input, but not populated from :some_model_values.
The second:
how could be collection of :some_model_values pre-modefied? Because i don want to show some options according to user role.
Thanks!
...
Hi,
I am reading a file that is 10mb in size and which contains some id's. I read them into a list in ruby. I am concerned that it might cause memory issues in the future, when the number of id's in file might increase. Is there a effective way of reading a large file in batches?
Thank you
...
In Rails, when I want to find by a user given value and avoid SQL injection (escape apostrophes and the like) I can do something like this:
Post.all(:conditions => ['title = ?', params[:title]])
I know that an unsafe way of doing this (possible SQL injection) is this:
Post.all(:conditions => "title = #{params[:title]}")
My question...
I have many instances of a Rails model, Post. When viewing an individual post, I'd like to create a form to create a child of Post called Comment. I'd like to prepopulate this form with a hidden tag that contains the post_id which is the foreign key in Comment.
The Railsy way to do this is to create a fancy-ish route such as:
/comment...
This might sound odd, but is there a 'Rails way' to have a model destroyed if a certain attribute is blank? Say I have a model like tags with just a name attribute or something, if the user edits the tag and deletes all the text out of the name field in the form I'd like the model to just be deleted.
I'm aware of the reject_if method, b...
Hi,
Could anybody help me make a proper regular expression from a bunch of text in Ruby. I tried a lot but I don't know how to handle variable length titles.
The string will be of format <sometext>title:"<actual_title>"<sometext>. I want to extract actual_title from this string.
I tried /title:"."/ but it doesnt find any matches as it...
I'm looking for the best way to write unit test for code that POSTs to an external web service. The body of the POST request is an XML document which describes the actions and data for the web service to perform.
Now, I've wrapped the webservice in its own class (similar to ActiveResource), and I can't see any way to test the exact XML ...