From reading the Selenium documentation, I can see that there is a "newPageLoaded" flag that gets set when you perform a page-loading action. I'm trying to find out if there's a way to get at the value of that flag as the page is loading.
How to do this using the Ruby client would be great. : )
...
While programming in C# using Visual Studio 2008, I often wish for "automatic" code generation. If possible, I'd like to achieve it by making my MSBuild solution file call out to Rake, which would call Ruby code for the code generation, having the resulting generated files automatically appear in my solution.
Here's one business exampl...
I have a many-to-many relationship like this:
class Event < ActiveRecord::Base
has_many :calendar_events
has_many :calendars, :through => :calendar_events
# ...
end
I want to make it so that when I call some_event.destroy Rails deletes the association records from the calendar_events table. Based on the API docs, I'm assuming yo...
I just started learning Ruby and I ran into a problem today.
numResults = /\d+/.match(ie.div(:id, 'results_label').text)
puts "Results found: "+numResults.to_s
while(numResults > 0)
.
. some more code
.
I get this error in my output:
Exception: undefined method `>' for #<MatchData:0x424c6d4>
Which is really strange because I mad...
I've launched a website today which makes heavy use of Starling and Workling to handle the background task queue.
Traffic has been heavy and although my server CPU/memory has not been under too much strain, the job queue is seriously backing up.
I am inexperienced with both Starling and Workling and urgently need to understand how I ca...
I changed my show controller to find records by their permalink rather than their id (for SEO juiciness).
def show
@project = Project.find_by_permalink(params[:id])
end
But, if I type in localhost:3000/projects/foo (and there is not a project with a foo permalink) I get a 500 server error instead of a 404 not found.
Why is this, an...
I am using polymorphic associations to track Comments in my project. All very straight forward stuff.
The problem I have is in querying based on the polymorphic association and joinging from the Comment model back to it's owner.
So ...
I have a Comment model
class Comment < ActiveRecord::Base
belongs_to :commentable, :polymorphic ...
I'm looking for guidelines on when to know when a RESTful approach to a model and it's associations is proper, and when it's not. Perhaps it's the nature of my current application, but I'm finding that simple models with no associations work well with REST, but complex models with many has_many assocations really seem to complicate the v...
I've been using vi/vim since '97 for various quick edits and
administration tasks, but have only recently considered using it to
replace Netbeans as my ruby editor of choice. One thing I find
extremely useful in both Netbeans and Eclipse is the Ctrl+Click "Go to
definition" feature, where you can ctrl+click on a class or method and
it wi...
When you present a message to the user that involves an entity that could be either singular or plural, Rails has a shortcut to handle that. I'm talking about this situation:
"Delete committee? Its X meeting(s) will also be deleted."
Rails has a way so that "meeting" is presented as "meeting" or "meetings" depending on X.
I can't reme...
Hi, my Rails app works fine locally. But once I put it on a server and in production mode, I get this error:
ActionView::TemplateError (undefined method `each' for nil:NilClass) on line #7 of app/views/admin/confirm.rhtml:
4: <br>Description:
5: <br><%= @description %>
6: <br>Features:
7: <% @features.each do |feature| %>
8: <br><%...
I have a rails application that triggers Emails on certain events. These emails are sent to a separate company who will add some additional data to the email when replying. This is all understood and working, I am parsing the replies, extracting the data and it works fine.
I have now been asked to encrypt the emails.
Does anyone have a...
Hi! I'm writing Cucumber tests for a Sinatra based application using Webrat. For some tests I need to implement a scenario like
Given I am logged in as admin
When I am visiting "/"
Then I should see "Settings"
I define steps like this:
Given /^I am logged in as "(.+)"$/ do |user|
visit "/login"
fill_in "login", :with => user...
Hi,
Rails 2.3 was released last week and I installed it with gem install rails. Everything is working fine. However, I noticed a bug, so I searched a bit and sure enough a new commit was accepted 2 days ago that fixes the same bug I saw.
How can I get these latest changes into my version of rails that I'm running locally?
I trie...
I am using RUBY to screen scrap a web page (created in asp.net) which uses gridview to display data. I am successfully able to read the data displayed on page-1 of the grid but unable to figure out how I can move to the next page in the grid to read all the data.
Problem is the page number hyperlinks are not normal hyperlinks (with URL)...
I have a rails project where the the view displays a list of items. I use acts_as_list to make the list DnD orderable and in_place_editing on each item to, well, edit it.
My problem is that when I DnD the items around, the item I drag automagically becomes editable when I drop it. Any tips on how I can avoid that behavior.
Ideally,...
My server was doing just fine up until yesterday. It was running Redmine (a ruby development tracking application), and it was the happiest little server until my "friend" imported a sql table that my little guy couldn't take. Unfortunately after an hour of trying to get the lil guy to respond, we had to power cycle him.
Now after res...
I have my json serialization working fine
render :json => "#{current_object.serialize(:json, :attributes => [:id, :name])}
But I also want to add further data to the json before it gets set back to the client. Mainly the auth_token.
Googled around like crazy but I can not find what option serialize will take to allow me to append/me...
I am stumped with this problem.
ActiveSupport::JSON defines to_json on various core objects and so does the JSON gem. However, the implementation is not the same -- the ActiveSupport version takes arguments and the JSON gem version doesn't.
I installed a gem that required the JSON gem and my app broke. The issue is that I'm using to_js...
I've a schema file (.xsd), I'd like to generate a xml document using this schema. Is there any online tool available,if not what is quickest way (like couple of lines of code using vb.net).
Thanks for your help.
-Vuppala
...