Why do I have this error when I try to upload a png files in production mode?
It works fine with jpg and gif files...
[paperclip] An error was received while processing: #Paperclip::NotIdentifiedByImageMagickError: /tmp/s3,8354,0.png is not recognized by the 'identify' command.>
...
I'm going to head off and look at the source to see if I can find what's causing this, but someone here's probably run into this before so... I'm doing a normal form_for:
<% form_for(@myobj) do |f| %>
But the URL it's generating is:
form action="/myobjs/%23%3CMyobj:0x105f03ec0%3E" class="edit_myobj" id="edit_myobj_13" method="post">
...
Hello,
I'm trying to migrate my app to Ruby 1.9, however ActiveRecord keeps retrieving records out of my MySQL database with an ASCII encoding, causing "incompatibility between utf-8 and ASCII" like errors. I've tried setting the "encoding: utf-8" in the database.yml file, and I've also tried putting " #coding: utf-8 " at the top the err...
I have a variable, start_time:
(rdb:5) start_time.class
ActiveSupport::TimeWithZone
(rdb:5) start_time
Tue, 23 Feb 2010 14:45:00 EST -05:00
(rdb:5) start_time.in_time_zone(ActiveSupport::TimeZone::ZONES_MAP["Pacific Time (US & Canada)"]).zone
"PST"
(rdb:5) start_time.in_time_zone(ActiveSupport::TimeZone::ZONES_MAP["Pacific Time (US &...
Is there a way to find all Polymorphic models of a specific polymorphic type in Rails? So if I have Group, Event, and Project all with a declaration like:
has_many :assignments, :as => :assignable
Can I do something like:
Assignable.all
...or
BuiltInRailsPolymorphicHelper.all("assignable")
That would be nice.
Edit:
... such that...
here are the requirement from marketing people:
1. they want to be able to setup google adwords and being able to create a landing page, select a template layout, and able to fill in matching title and description. Unique, readable URL is important as well.
2. they want to be able to modify static pages on the site, e.g. about us, FAQs, ...
How would you check if javascript is enabled in Rails? So that I could do something like this in the views:
<div>
<% if javascript_enabled? %>
<p>Javascript Enabled!</p>
<%- else -%>
<p>No Javascript</p>
<%- end -%>
</div>
...
Hey, I'm using Rails 2.3.5 and using rufus scheduler to send periodic emails. This works fine in development mode, but surprise surprise production mode has borked something. I've set the same actionmailer settings in both development and production files. Is there something I am missing?
...
Thanks to some great help on SO, I managed to get a WYSIWYG editor with Paperclip integration working for my app: http://stackoverflow.com/questions/2277348/wysiwyg-image-uploads-in-rails-app
I'm seeing some interesting behaviour where my WYSIWYG editor disappears if there is a validation error.
The editor includes are defined in appli...
In the Hibernate world, you can often have unit tests that appear to pass but there are actually bugs that don't show up because you're dealing with cached data. For example, you may save a parent with its children thinking it's cascading the save. If you re-query for the parent after the save and test the size of the child collection,...
I have a working HABTM association between the models
Posts and Users... the posts_users table is as advertised and both have the necessary has_and_belongs_to_many in their model.rb
And if I use User.find(1).posts it will find all the posts with the valid username
My question is how to deal with this situation.
I want to use
user.po...
I'm one of those developers who isn't using TextMate with any of his Ruby/Ruby on Rails work. My particular loyalty in this arena lies with vim. What are your favorite tips/tricks for using vim with Ruby and/or Ruby on Rails to make you as efficient as possible when working?
...
I am trying to populate a nested field, product_name, it an Item.
In my Item model:
class Item < ActiveRecord::Base
attr_writer :product_name
belongs_to :order
belongs_to :product
def product_name
#Product.find_by_id(self.product_id) #=> returns the product object
#self.product #=> returns the product object
...
I want to add a simple onChange event to a select list I have in Rails. How do I do this?
This is the select box code:
= f.select(:question_type_id, QuestionType.all.collect {|qt| [ qt.name, qt.id ]}, { :include_blank => "Please Select a Question Type" })
The onChange event is supposed to call a function, fillAnswerNumber(), which t...
I'm using RR for mocking and stubbing in RSpec, and I've run across a situation where I'd like to stub a method from a super class of a controller that sets some instance variables. I can work out how to stub the method call and if I debug I can see that my stubbed block is called, but I cannot get the instance variables in the block to ...
i am new to RoR and following AWDwR book...
all was well till i started the Depot project....
created the products model using
ruby script/generate scaffold product title:string description:text image_url:string
now when i view the page http://localhost:3000/products it shows a generic page with nothing in the list and a link to add...
I install plugin open_id_authentication and have this error:
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to load -- rack/openid (LoadError)
when I try to start rails server
Actually, rack-openid installed in my system and i can load it from irb:
irb(main):00...
Hello, I have a Rails application with database that is updated from external C++ program. I'd like to speed up the app using fragment caching but when a record is updated a coresponding fragment cache entry needs to be expired. Any ideas?
...
I'm working on an kind of an RPG game. And I'm trying to figure out
a nice, clean and RESTful way to define inventory API.
inventory consists of several slots like head, chest etc (like in most RPG games).
Now I need to define REST API to move all items from slot X to slot Y.
few ideas I had:
well, obviously the inventory lives at /...
Hi there!
I need to use JQuery in order to detect the changes on a text file, so some ajax is invoked.
The trick is that I don't really want to bind this action to the blur or keyup events; The former is too cumberstone for the user and the second is "too inmediate": the user types new keys before the ajax call has been completed, so t...