similar to: Images larger than 40k uploaded with attachment_fu won't display

Displaying 20 results from an estimated 2000 matches similar to: "Images larger than 40k uploaded with attachment_fu won't display"

2007 May 14
6
ActiveResource and RESful edit
Hi I''d like to know how to have ActiveResource generate a URL for the /teams/1/edit type of resource. I''ve got custom_methods.rb and have used Team.find(1).get(:edit) This generates http://localhost:xxxx/teams/1/edit.xml But all I get returned is a hash of the attributes (in this case of team 1), rather than an object of team 1. In other words the
2007 May 05
3
DB trigger vs before_create
Hello everyone, I''m having trouble figuring out which approach is better. I have the following tables: products, orders and line_items. Every time an Order is placed, the quantity field in the products table has to be updated for each LineItem in the Order. One option is to use DB triggers which is not as portable as using before_create in the Order model. But with before_create I cannot
2007 May 04
5
Something wierd with .save method
Hi, I have a very sime app. I need to create as many records in the db as the selected checkboxes (named :isselected) in the view. Here is the code snippet from the controller: isselectedhash = params[:isselected] for mod in isselectedhash.keys @issue = Issue.new(params[:issue]) @issue.state = ''NEW'' @issue.mod_id = isselectedhash[mod] # this gets
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up!
2008 Mar 14
3
ActionController <-> ActiveView code access ambiguity
Hi All! This is not a problem in general but i''ve just missed the point. If my application has a global state, which i have to use both throughout ActionController and ActiveView, then, where to place that state? E.g. if I do this: class ApplicationController < ActionController::Base protected def authenticated? !user.nil? end end then I can''t use that from any
2007 May 23
8
ImageScience, Mini-Magick and RMagick
I''m going to be generating thumbnails from user uploaded images. I''m looking around at the libraries available to do this sort of thing and there are three that look promising. ImageScience -- http://seattlerb.rubyforge.org/ImageScience.html Mini-Magick -- http://rubyforge.org/projects/mini-magick/ RMagick -- http://rmagick.rubyforge.org/ It looks like a lot of people are
2007 Mar 10
6
ActiveResources 0.1.0 Released
See the blog post at http://blog.lonestarsoftware.net/2007/03/09/active_resources-010-released/ Reading through the rails blogosphere last week, I read a post (which I can not find again) that suggested a completely different approach to AJAX use in rails apps. The idea was to create a Javascript proxy to the ActiveRecord models and allow AR operations to be called from the client. I see this
2007 Jul 24
9
will_paginate plugin doesn't work with Association Extensions?
I have: class Post < ActiveRecord::Base has_many :comments do def published find( :all, :conditions => {:published => true} ) end end end When in my controller I do Post.find(:first).comments.published.paginate :page => params[:page] I get an error undefined method `paginate'' for []:Array Is will_paginate supposed to
2007 Jan 25
2
render .rhtmlx if present, otherwise render .rhtml
We have a product where our customer is "allowed" to make minor changes to the .rhtml views. Obviously, this can be an issue when updating the software, as changes need to be merged in. Also, sometimes the customer wants to back out there change but no longer has the original file. SOOO.... I''d like to tell them - if you want to change a .rhtml file - just copy it to
2007 Nov 08
5
Rails byte-range request support
Hi, I''m trying to serve the iPhone a video file from my controller using send_file. However, it appears as thought the iPhone requires byte- range request support and rails doesn''t seem to support this. If I give the iPhone a url that points to an actual file (i.e. it''s served by my webserver nginx, instead of rails) it downloads and plays it fine. Here is the proof
2007 Dec 30
6
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded today) and upon running the generator, doing the migration, prepping the test system and putting the resources in routes.rb I get a Rspec test failure: ''SessionsController logins and redirects'' FAILED expected not nil, got nil routes.rb has: map.resources :users map.resources :sessions nothing else was
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb: map.resources :product_categories it provides urls such as: /product_categories /product_categories/1 /product_categories/1;edit etc. and uses the ProductCategories controller. how can I keep the same controller (and model) but set up the resources so that I can have any abitrary url point to the existing controller, much like specifying the controller
2008 Mar 19
7
Upgrade to 2.0.2: InvalidAuthenticityToken error on 1st POST
All, I''ve upgraded to 2.0.2, and I can''t get my login screen (the first POST request in the application) to work. When I post this form, I see the "InvalidAuthenticityToken" error. I have protect_from_forgery :secret => ''my_secret'' set in application.rb and I am using an active_record session store based on this line in environment.rb:
2008 Feb 27
8
ActiveRecord validation messages not I18N-friendly and enforces grammar
ActiveRecord validation messages are currently not I18N-friendly. Specifically, I''m referring to the fact that it enforces a certain grammar, namely the beginning of the message must consist of the field name. For example: validates_presence_of :name, :message => "can''t be blank." ...generates the message "Name can''t be blank". This grammar
2007 Feb 01
12
RESTful Rails and other musings
Hi all, I would first like to introduce myself to the Ruby on Rails (RoR) community and to say that I hope to begin to build some relationships with other RoR developers. I''m a long time Java programmer (5+ years). Java was my first experience with Object Oriented Programming (OOP). Before Java I developed using many other languages including C, Pascal, Fortran, BASIC, Visual Basic,
2007 May 10
13
REST own action
I can sent my own action to a users_controller stating in routes.rb map.resources :users, :member => { :network => get } I defined in my users_controller the network action.... so I can have an url like "http://localhost:3000/users/168.xml;network" now I would like to have another action network_plus which is a little bit different fron the network.. sure, I can state another
2007 Mar 28
1
attachment_fu & update_attributes... bug?
It seems that attachment_fu is a pretty popular plugin (it''s great), but I''ve been having a terrible time trying to figure out an issue when using "update_attributes". I''m storing files on the file system rather than in a database. It seems that when "update_attributes" is called with a new file, upload_data= tries to copy a file that
2007 Jun 06
10
Attachment_fu S3 uploads killing mongrel
I was wondering if anyone here has seen a similar error to this... >From mongrel.log /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ transactions.rb:85:in `transaction'': Transaction aborted (ActiveRecord::Transactions::TransactionError) from /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ configurator.rb:293:in `call'' from
2008 Feb 04
2
attachment_fu and form_tag for multiple models?
hi, i''ve got a page where i''m trying to save the user''s profile information and an image of the user, but i''m having trouble with using attachment_fu and the form_tag method. now i know attachment_fu isn''t designed for form_tag but am really hoping someone has a solution for this as frankly i''m stumped. here''s the form_tag part in
2007 Apr 21
3
attachment_fu thumbnails
howdy! I had the problem that attachment_fu didn''t make a thumbnail, but everything else worked. I read this post http://www.ruby-forum.com/topic/104213 and added a parent_id column. now I get the following error when I trie to add a photo: undefined method `find_or_initialize_by_thumbnail_and_parent_id'' for Photo:Class my code is: class Photo < ActiveRecord::Base