I have a photos model and a gallery model. The gallery model(I used nifty scaffold) just has one field, a gallery name.
In my photo edit form I want to link each photo to a gallery, eg. I create 2 separate galleries 2009 and 2010, I want to have a dropdown list on each photo edit page with the list of galleries, so each photo can be plac...
I have this
<%= link_to_remote "Next",
{:url => { :controller=>:objects,
:action=>:filter_recent,
:page=>@objects.next_page},
:with => "Form.serialize('filter')" },
:after => "alert('hello')"%>
I've tried :before, :after, :loading, :complete... none of them appear to be working... I know the button w...
I'm trying to point the Hudson app at the test environment in my MySQL database with Rails. Do I need to change the environment variable RUBY_ENV? If so, where do I implement this?
...
After correcting some other bugs on the application I found out that one page is being rendered twice on every request.
Rails completes the request normally and after a few, simply starts another request.
At first thought it was a Firebug problem or YSlow doing other requests, but after more tests the duplication remained and I discard...
Here is the stacktrace I get in the console:
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant ActiveRecord (NameError)
from C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
from ...
Hi. I am very new to Rails and Cucumber so this may or may not be a quick fix.
I have a cucumber scenario that loads a collection of models and then checks to see if they are all rendered to a table. Cucumber returns a result saying "Tables were not identical". What am I missing here? I have tried to add headers in the second step defin...
ruby -v = 1.9.1p378; rails -v = 2.3.8
wkhtmltopdf works just fine from the command line - generates a PDF. The path to the .exe is in the %PATH% variable as well as specified properly in the /config/initializers/wicked_pdf.rb file.
Set up the controller action to handler .pdf format but I get the following error
Permission denied - c...
I had a file I needed to edit in my .gitignore file.
I edited .gitignore, committed it, and still my file was unavailable to commit.
I deleted the file, readded it, and once it has the same name, its still unavailable to commit.
I tried -f, which then added an empty version of the file to my repository. And the worst apart about that ...
I have a simple email entry that is supposed to flash a notice "Email cannot be blank or invalid" when the user pushes the submit button and the email is blank or invalid. I've managed to get that working so the notice pops up just on top of the email entry form. But what I want is the error message to be directly over the email entry fo...
I'm running Teambox (a Ruby on Rails app) and have the server running with:
script/server -e production
Knowing absolutely nothing about Ruby on Rails I just wandered how I could restart the server to get it to update changes I've made to the config?
...
I'm sure this is a really simply question, and I apologize if it is...
I'm using Rails 3 and jQuery, and am trying to bind an ajax:success to a remote form submission. The data that is being returned by the function will be in JSON format - and for some reason, I CAN NOT ACCESS the data. I don't understand how to fix it. Here's where I ...
I have a fairly complex Rails app built on top of Twitter's API, and want to make the whole app case-insensitive.
Up until now, we've been converting all usernames and other strings to .downcase whenever possible and using the default case-sensitive searches, but that's starting to cause problems, with 'Username' and 'username' being c...
I have a number of Rails apps hosted on GitHub. They are all currently private, and I often will deploy them from their GitHub repository. I'd like to be able to make some of them open source, just like the ones you can find on http://opensourcerails.com.
My question is: How can I make these repositories public without giving away super...
I have been thinking about my shift from Java to Ruby and the thing that strikes me most is Ruby's lucidity ( I know the word lucidity is a qualitative abstract, I guess people who are riding on the same boat will comprehend). Sometimes, I feel I am almost writing psuedo-code.
Does Ruby take the paranoia out of programming and make it ...
I want to show a post author's name; <% @post.author.name %> works unless author is nil. So I either use unless @post.author.nil? or add a author_name method that checks for nil as in <% @post.author_name %>. The latter I try to avoid.
The problem is that I may need to add/remove words depending on whether there is a value or not. For i...
I'm writing a web app which is used a SaS. Each customer has their own db and app directory so I have a rake task which creates all necessary minimum data (seed data) to run their website: default rights and roles, a superadmin user, a "us_states" table already populated, some local depots and terminals (it's a logistics app).
I don't h...
Gallery has_many photos.
Photos belongs_to gallery
In my photo 'show' view I get the error 'undefined method `name' for nil:NilClass' for the line
<%= @photo.gallery.name %>
the error only appears on photos that aren't part of a gallery (that don't have a gallery name assigned to them) the ones that do, appear as expected i.e the gal...
I'm planning on using Bit.ly Pro and the Bit.ly API to make my own short urls in a Rails 3 project.
I've got a User and a Note model. And a url structure like this: '/username/1-note-title'.
Now I would like to give each note a short url. But I don't know from where I should do the API call. Right now I got this code in the Note contro...
Hello
Today I started using the spreadsheet gem to make my excel files, but one of my column is a date, and I want to format this column as a date. It looks like it is in there somewhere, with the date method in Spreadsheet::Excel::Row, but I can't make it work.
Any hero out there?
...
Hi,
I'm having trouble deleting from active record store.
I want to delete based on the session data:
ActiveRecord::SessionStore::Session.find(:all).each do |s|
if s.data[:userid] == 1234
s.destroy
end
end
does not seem to work, but:
ActiveRecord::SessionStore::Session.delete_all(["updated_at < ?", 12.hours.ago])
seems to...