similar to: FileColumn question

Displaying 20 results from an estimated 300 matches similar to: "FileColumn question"

2010 Sep 08
2
subbing a string vector for another string vector
I have a data frame with two columns: image pattern 1 http://$IMAGE_ID$ www.url.com/image.jpg 2 $IMAGE_ID$ http://www.blah.com/image.gif ... I want to replace "$IMAGE_ID$" with the corresponding entry in the pattern column such that the result would appear as follows: url http://www.url.com/image.jpg
2006 Sep 03
7
using polymorphic associations with acts_as_list
This is what I have class Photo < ActiveRecord::Base belongs_to :image, :polymorphic => true acts_as_list :scope => image end class Place < ActiveRecord::Base has_many :photos, :as => :image end class Child < ActiveRecord::Base has_many :photos, :as => :image end I want to be able to reorder the images. What I need is for the position of the photos to be set
2006 Jul 18
5
SQL query question
Hello, I know it''s off-topic. But I''m sure you are using SQL and can help me ;) I''ve a table CARS and a table KEYS and a LOCKS table. CARS id|name 1|audi 2|ford 3|mazda 4|porsche ... KEYS id|car_id|lock_id 1|1|1 2|2|1 3|2|2 4|3|1 5|3|2 6|4|1 7|4|2 8|4|3 ... LOCKS id|name 1|main 2|spare 3|engine ... A car can have many keys. Keys are for different locks. How can I
2017 Jul 18
2
lme4 question
Hello, I am trying to run the following model: domi ~ type*ratio+((1|id)+(0+type|id)+(1|face_id)+(1|car_id)) My question is whether the data coding for "face_id" and "car_id" variables is correct. As you see on the following sample data structure, "type" is repeated measure where 1=car, 0=face. Thus, I coded "face_id" as "0" when the type is 1
2008 Jul 08
4
Conditional "link_to" helper function - AYUDAME POR FAVOR
Hello, I need to write a function that will return a link only if the current user is the owner. Here is my code... 1. application_helper.rb 2. 3. def link_to_if_owned(owner_id, anchor_text, where_to_go) 4. if current_user.id == owner_id # current user is owner 5. "#{link_to anchor_text, where_to_go}" 6. else 7. anchor 8. end 9. end And
2008 Jan 22
1
getting multiple select to work: options_for_select
Hi, <%= select_tag ''image_id'', options_for_select(Image.find(:all) {| an_image| [ an_image.name, an_image.id ] }), :multiple => true %></p> * I am in a view, and I am trying to search the image table and make a multiple select box with each image''s name. * Right now it is working, but I see this: ---------------------------------------------
2006 Jul 17
6
3 newbie questions
hey all, I have 3 tables like this: Images (id,name) Tags (id,name) ImagesTags(imageid,tagid) in my image model I do a "has_and_belongs_to_many :tags" but to make it work I need to rename ImagesTags(imageid,tagid) to Images_Tags(image_id,tag_id). My question is that given that I can''t rename the table, is there any way to make it work with the original names? Second question:
2012 Jul 18
0
Rails 3.1 Optional Routes
Hi all, I am using Rails 3.1 and Ruby 1.9.2 In my application i am using optional routes like below match ''Gallery(/:gallery_id(/:image_id))(/page/:g_page)'' => "wps/ gallery#show_gallery_page",:as => :gallery_page in console i am trying to call the routes like below include Rails.application.routes.url_helpers => Object 1.9.3dev :002 > gallery_page_path
2006 Jun 10
0
Dynamic file paths in FileColumn
I have a file uploader application in ROR using the very nice FileColumn plugin. In looking at the source code I can see that there is a DEFAULT_OPTION hash with some root path options and such which can be merged from an options paramater. These static path changes are not a problem. My question is dynamic path options. My upload form, when you boil it down, has two fields. The first is
2006 May 19
1
FileColumn
I''m using Windows and Postgres 8. I installed RMagic gem thingy and FileColumn plugin ok. I followed instructions exactly as directed on FileColumn web site which is very straight forward: ---model class My_model < ActiveRecord::Base file_column :column_for_file_name end -----view -upload form--set to mulitpart <%= file_column_field "my_model",
2006 Apr 05
0
FileColumn - version and not image files
Hi I have this filecolumn: file_column :file, :magick => { :versions => { :large => ''756x567>'' } } Does anybody have a solution to make this also accept files that aren''t images? Now this makes filecolumn return an error of "File invalid image" if the file isn''t an image. Would be nice if it, when the file is invalid image, just
2005 Dec 27
1
filecolumn to database
Hi, I''m using filecolumn to upload a file to mysql blob : _form.rhtml : file_column_field "entry", "attach" model (rb file) : file_column :attach How can I update controller create function to insert file in database ? redefine model save function ? Someone has a sample source ? Regards, Fabian
2005 Dec 29
3
FileColumn Help
i''ve changed store_dir to :store_dir => "public/uploads/users/pictures/" that works great for uploading, but url_for_file_column is still outputting: /user_picture/image/id/name.jpg how do i make url_for_file_column output the correct url? -- Posted via http://www.ruby-forum.com/.
2005 Dec 04
2
Filecolumn: url_for_file_column problem
Calling url_for_file_colum results in a TypeError: can''t convert nil to string. The error is in line 148 of filecolumn.rb: def relative_path(subdir=nil) File.join(relative_path_prefix,subdir, @filename) end If I substitute '''' for subdir in the File.join command, then it seems to work fine. Since this is a plugin, I''m wondering why I need
2006 Mar 30
0
FileColumn Redux
I installed FileColumn successfully but now find the need to get a new image size. I was wondering if there was a fast script, or method, that would run through all my products and use the existing mail file already submited and resize it according to the new specifications. Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Mar 23
5
Filecolumn storage location
Hi, I am using file_column for some image uploading. I want to have all the images stored under one root which I have managed by setting the :store_dir option as below. file_column :filename, :store_dir => File.join(RAILS_ROOT, ''public'', ''images'', ''products'') So, my images get uploaded to: /public/images/products/<primary_key>
2009 May 25
0
NameError (uninitialized constant FileColumn::Magick::ImageList
Hi, I have been using RMagick and File Column in my app together without a problem, but when I tried to add in some new functionality in my model where I use file_column, I got the error in the subject line. The offending line in my code is: image = Magick::ImageList.new(path_to_image) Has anybody ever seen this problem when using the two libraries together? I have tried adding in a require
2006 May 15
5
Finding out the file attributes in FileColumn models
Is there a way to find out the attributes that have been passed to file_column in models? I''ve looked through the source and it seems that the file_column methods are generated at runtime but there''s actually no class or instance variable that hold the file attribute. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jul 30
1
FileColumn - Validate Before Saving
file_column is great -- but I need a way to run through the validations (ie: validates_file_format_of) before saving. That is, when a user first uploads an image it is displayed in the view but not ''saved'' until they click the ''Save'' button on the form. I want to display an error message/disable the ''Save'' button if the file they just
2006 Aug 09
8
AJAX image manipulation
I have this code in a controller that returns images to my browser...with ROR. def index @products = Product.find_all_ pictures end ....this is the .rhtml.. <% for photo in @pic -%> <div class="entry"> <img src="<%= photo.image_url %>"/> <h3><%= h(photo.title) %></h3> <%= photo.description %>