Hello there,
after using this excellent peace of software called FireWatir, I wonder if there is a way to integrate jQuery-selector-magic to my test.
My first attempt is to use firewatir's js_eval() method like this
require 'rubygems'
require 'firewatir'
f = FireWatir::Firefox.new
f.js_eval("alert(42);")
The only thing I get is a
...
is there another way to delete sessions variable? i was thinking of sessions = nil
...
I want to give a functionality to a photo sharing web site and the option of sharing and saving links. What would the code look like?
...
I wonder why i cant decode this json string, all what i want is to convert this to a proper Ruby hash, anyone have an idea? i think the array of objects is cracking it ?
Parameters:
{"{\"origins\":"=>{"{\"origin\":\"this\"},{\"origin\":\"dont\"},{\"origin\":\"dont me please\"},{\"origin\":\"and me please\"},{\"origin\":\"dont\"},{\...
Hi guys,
Beginner jquery question. I am using the Tokenizing Autocomplete Text Entry plugin, with the goal being to create a similar input as the SO Tags feild.
I got it pretty much working, but the issue that I am having is that when I edit my Story model (/stories/1/edit) the tags field appears blank (I guess the plugin makes a bra...
I'm trying to figure out the best solution to create a "game-round" timer in Ruby/Rails. Right now I'm just jotting notes, but in theory I'd like to set a 30 second timer on each round of game activity. Once the timer hits 0, the users turn is over.
On Ruby's end, I know I can accomplish this with a while loop and sleep(30), or some c...
Hi,
I'm going to have to move a Rails 1.1.2 app, because my hosting contract is going to expire.
I haven't done anything to the code for a few years and I would like to know what would be the best way to upgrade my app. Many things have changed since then, RoR isn't using a localization plugin anymore but i18n, etc..
I would like to r...
Hey all,
This code does not upload the intended value to the database. I was expecting that if 2001 already exists as a student_number value for a record which has another column site 1 (represented by site_id), then we increment student_number by 1 so next value of student_number for that site would be 2002 and next value 2003 and so on...
Let's say I have an ActiveRecord called Apples, and I want a class method that calculates the total price of every apple in my database, as so:
def Apples.total_price
Apples.sum(:price)
end
This is a method I use in one of my views to make a pie chart. So, something like:
Apples.brand("red delicious").sum(:price)/Apples.total_price...
I've found an old plugin called acts_as_habtm_list - but it's for Rails 1.0.0.
Is this functionality built in acts_as_list now? I can't seem to find any information on it.
Basically, I have an artists_events table - no model. The relationship is handled through those two models specifying :has_and_belongs_to_many
How can I specify ord...
I have a process I'd only like to run when I manually reboot my Rails app by touching tmp/restart.txt, not when Passenger restarts itself after an idle period. Is there anything I can check in my Rails code to determine whether a given reboot was one or the other?
...
I am working on Ruby on Rail web site and I am using MySQL for database support. Now I would like to know: is it possible to use stored procedure in my Ruby on Rails application? If possible can you provide some details?
...
I have a ruby application that's used by users via a rails web app.
The use case that i need to solve is: each user needs to compile create an entity on database via the web page and put a really big attachment (can be 100gigs or more too) related to the entity.
Now this is too big to be handled by normal upload plugins, i am searching...
When I modify an ActiveRecord object during a session, I cannot seem to retrieve this modified instance in a method call. A simplified example follows:
Assume we have a model with only two objects: Project and Task linked with a 1-n relationship. Both objects can be active, but tasks require their parent project to be active before ac...
I have an FBML canvas app and I have a few places that I currently display forms in their own pages, but we'd like to move these to dialogs.
So, could someone give an example of using a link to popup a dialog with a form in it and handling the submission of that form in the controller?
...
Is it acceptable to call ActionText from within ActiveRecord?
def last_updated
updated_at? ? "Updated #{ActionText::time_ago_in_words(updated_at)} ago" : "never updated"
end
Is there an argument against doing something like this? Should this be a helper method?
...
I have multiple user account types, each with different information. For example, business contacts link to businesses, school administrators and students link to schools. Students have physical addresses, but business contacts and school admins use the organizations address. There's other information unique to each type as well.
I'm le...
How can I run Rails on Maglev? It seems that it can run Sinatra, but not full blown Rails.
...
Hello. Is it possible to rename a column using a command like:
script/generate migration AddColumnToTable column:type
? Thanks.
...
I'm attempting to use the fields_for command to combine two models edit functions. I'm editing several variables. With these variables I'd like to include some basic information that is associated with the model, such as @line_item.inventory.item. The only way I could accomplish this is by creating a double loop which doesn't work for ob...