Just looking for some advice on how to structure my relationships in an app that I'm making. I have the following models:
activity # golf, karaoke
event # golf competition followed by all-night karaoke boat party
post # write-up of the golf and karaoke event mentioned above
gallery # photos from the golf and karaoke event
Que...
Hello,
First, what I am trying to do is:
I am trying to create a browser application that works on clientside. The basic idea is the user uploads a xml file into javascript. Javascript does calculations on this data and displays results onto the browser. The user is able to interactively edit the result (something like an image/video) ...
Hi there,
I'm trying to install some Gems and need to run the following command:
gem install mongrel mongrel_service mysql ruby-postgres oniguruma
ultraviolet libxml-ruby --no-ri --no-rdoc --platform=mswin32
However, that --platform=mswin32 at the end of it bothers the hell out of me. I mean, my platform is x64 as it's supposed to b...
Hi all!
When I do script/server I don't seem to get any deprecation warnings. I know that I should at least be getting one about {{word}} in I18N. Can anyone point out where I can find them? Or how I can enable the deprecation warnings?
Regards,
Jacob
...
I have a site which is currently implementing i18n using ruby-gettext package methods. All of the marked content within *.rb, *.erb, *.rhtml can all be translated and displayed correctly. But for lots of text stored in *.yml can't be displayed correctly although those marked strings have been inside of po files.
Original yml file exampl...
Hi,
Is there anyway I can detect a exception and stop a plugin from loading in Rails?
Thanks,
Sivakumar.
...
How do I return an image inside the respond_to do |format| block?
I already have the image fully assembled (i.e. no ugly assembling from blogs) and at a particular URL (because it's in the public folder), I just need to be able to return that image for a particular other URL query.
For example, the image is in
public/cars/userid/car...
I am using the Paperclip gem to resize upload photos and store them on amazon S3. I need access to the resized photo to also pass along to another web service, during the lifecycle of the upload request.
I suspect there is a temp file created somewhere the imagemagik uses before the photo is uploaded to s3. How can I get access to it....
Hello, rails 3 seems to escape everything, including html. I have tried using raw() but it still escapes html. Is there a workaround? This is my helper that I am using (/helpers/application_helper.rb):
module ApplicationHelper
def good_time(status = true)
res = ""
if status == true
res << "Status is true, with a long ...
Just like the title says :
= image_tag @organization.logo.url(:cropped)
I want this to appear as
<img src="picture.jpg?23412341234" />
...
I know that "helpers" are usually for views/templates. But say I have a helper method that I want to call from different controllers. Where should this file go?
I was thinking of creating a helper module in the "models" folder but I'd like to know if there's a "correct" way to do this.
...
When I run 'rake test' I get this error:
1) Error:
test_the_truth(DetailsThankYouTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: details: DELETE FROM "details" WHERE 1=1
The application runs fine but I cannot write any simple test. How can I disable Rails test to use the table?
...
I would like to toggle (hide/show) several elements of my web page.
All those elements are in between this tag:
<div class="class_name">to toggle</div>
<div class="class_name">to toggle2</div>
I would like to use javascript to toggle all the elements with class=class_name when the user clicks on a button.
So far all the code I ...
Hi,
I'm new to rails. I want to know about file uploading process in rails. Can anyone please help me...
Thanks,
Althaf
...
Hi there,
I know the following model code is not correct: as models get loaded only on server boot, time "constants" are loaded at that time only, too.
class Article < ActiveRecord::Base
def expiring?
if (self.enddate - Time.now) <= 1.day
true
else
false
end
end
end
What do I have to correct how, so that...
I'm attempting the following functional test on the controller. I'm using the following
RSpec2
Rails 3
Shoudla
Mocha
Here's the test
context "POST on create should be successful" do
before(:each) do
Model.any_instance.expects(:save).returns(true).once
Model.any_instance.stubs(:id).returns(1)
post :create, :model => {}...
Hi,
According to Simone Carletti blog post, Rails 3 ajax helpers have changed a lot. We are supposed to write more javascript with rails 3 than we used to with rails 2.
I tried to figure out how to show up an ajax loading gif -while an ajax query is running- in the "rails 3 way". I came up with this kind of code, which uses javascript ...
Hello!
/home/soroush/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
no such file to load -- ZenTest
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/loca...
Windowsxp. Ruby192. Rails installed. Mysql installed. When I try to run gem install mysql2 (or bundle install) I get errors:
C:\ruby\cred2>gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
ch...
Will jquery-ujs give me all the helpers etc. that are used for all ajax helpers etc. that worked with prototype/script.?
...