similar to: send_data not working properly with link_remote_to

Displaying 20 results from an estimated 1000 matches similar to: "send_data not working properly with link_remote_to"

2006 Jan 09
6
Rendering dynamic Gruff image (send_data)
Dears, Got a controller witch do a send_data for displaying a chart. like : send_data(g.to_blob, :filename => "any.png", :type => ''image/png'', :disposition=> ''inline'') I actually do a <img src="http://myhost:3000/stats/make_graph" /> Is there any way more clean to do that ? At minima don''t hardcode the beginning
2007 Apr 09
6
gruff send_data
Hi, for those with experience of Gruff module: suppose I want to send image from server straight to the browser (as example on gruff web site): send_data(g.to_blob, :disposition => ''inline'', :type => ''image/png'', :filename => "gruff.png") the server seems sending this binary data ok, but I am having
2006 May 30
1
Can''t read from file field second time around
This piece of code takes an uploaded image and resizes it. It''s a bit nasty at the moment as I am still messing around with it. What I can''t understand is why it works for one iteration but then fails with: zero-length blob not permitted `'' On the line: img = Magick::Image.from_blob(self.image).first I am basically doing this in the controller and it fails on the
2006 Jul 25
1
How do I validate using associated objects?
This doesn''t make any sense to me anymore. I have an Upload that belongs_to a Comment. Within my Upload model I expect to be able to access the associated comment with comment.foo. I can only seem to do this AFTER validation. I''m assuming before_create takes place between validation and updating the database, because when I try to access comment.foo within the validate
2008 Dec 04
2
Does animated gif will work properly using RMagick?
Dear all, I have used RMagic to read and write a image while uploading. An animated gif was read from my local machine and was written in my images folder using RMagick. But the animated gif which i read was witten in my folder without animation. What should i do to write the gif image with animation. Here is my code to read and write image while uploading. image = params[:image][:blob]
2006 Apr 24
1
implementing a Slider control
i''m trying to implement a slider like "http://wiki.script.aculo.us/scriptaculous/show/SliderDemo", but i see that my code doesnt work. i seem to do everything correct but then if some one could look into it and help.. regards muddana The View Code: <%= javascript_include_tag "prototype", "effects"
2006 May 25
2
Have a quick Gruff Graphing question
I have some graphs and everything is working great, but I''d like to set a minimum height so to speak on the vertical scale. Is there a method to do that with Gruff? I''ve tried looking through the docs but can''t seem to get it to work. So for example, if the highest datapoint in my graph was say 500, is it possible to have the minimum vertical scale on the left set
2009 Dec 24
2
Showing graphs on browser with gruff lib.
Hi, I am using "gruff" lib for creating the graphs. I have got the success to create the graph, but my problem is I don''t want to store it, I want that they should be displyed on the browser it self. I have tried this:- " send_data(g.to_blob, :disposition => ''inline'', :type => ''image/png'', :filename =>
2006 Nov 04
0
send_data from disk
Hi, I''m trying to use send_data to stream a file that is stored on my disk (not as a blob in the database.) So, this is what I''ve tried: send_data File.new(filename).read But, the file doesn''t download. I think send_data expects something other than a String (which is returned by File.read.) Anyone know how to get this working? The reason this is being done is to
2009 Nov 08
2
send_data with jpeg not working
I''m a newbie having trouble using send_data to send a jpeg file to the browser for display in an html img tag. This is the relevant code from my controller (photos_controller.rb): def retrieve @photo = Photo.find(params[:id]) send_data File.read(@photo.abs_img_path), :type => "image/ jpeg", :disposition => "inline" end def download @photo =
2010 Apr 29
2
send_data => invalid byte sequence in US-ASCII
I''m trying to display a generated .png plot via send_data(), but it results in a server error "invalid byte sequence in US-ASCII" error. I''m pretty sure this means that I need to specify the encoding somewhere, but I haven''t been able to figure out where or how to do so. Some particulars: I''m running gnuplot through a pipe to generate a plot in .png
2006 May 22
2
Problem with send_data and csv file produced
hi, i did a search and couldn''t find wat''s the problem with my code... it seems everything is the same and the result is what i expected but i am not sure where went wrong.... using send_data function to send the csv file to the client, the file sending is successfully but when i opened the csv file, something is wrong... every statement got a "......" inverted
2006 Jul 07
3
quick send_data question...
Hi, I am using send_data to allow users to download files from the database but ran into a small problem, it seems that files upload fine but when they download only 64kb of the file is sent. I''m using the basic rails code from the Agile book: #upload code in my sheet model def file=(document_field) self.filename = base_part_of(document_field.original_filename)
2012 Mar 13
1
send_data always sends xml file?
I''m trying to use send_data to send a simple text file. Every reference I can find says I can supply a MIME type with the ":type" option and that will determine the kind of file I get on the machine that downloads the file I''m sending. Instead I ALWAYS get an XML file. here''s the code snippet: File.open(@temp_download_file_path, ''r'') do
2010 Dec 22
0
image_tag and send_data
i''m storing images in database. i have this action in controller: def image begin item = StoredItem.find(:first, :conditions => {:id => params[:id]}) rescue return end return if item.nil? if item.image_binary.nil? render :nothing => true else send_data(item.image_binary, :type => item.image_datatype, :disposition =>
2007 Jul 24
0
send_data and ie
Has anyone else had trouble using send_data with internet explorer. As usual things were working fine in firefox and safari until I tested in IE :). With the following code I''m seeing an image show up in firefox but the "X" indicating no image found in IE. Any ideas? @image_data = Image.find(:all, :conditions=>{:url => "http://reddit.com"}) @image =
2010 Nov 03
2
send_file but not send_data?
So this is the original code I used, and it worked send_file ''vendor/sprites/not-found.png'', {:filename => "sprite-not-found.png", :type => "image/png", :disposition => "inline"} Now I switched it to this (going to be adding imageMagick) send_data File.read(''vendor/sprites/not-found.png''), {:filename =>
2006 Sep 12
2
Generate JS from RoR - strange delay with send_data
Hi! I need to generate some JS from Ruby. This is no AJAX related stuff so RJS templates are not help to me. Also I want to not mix JS with HTML, so putting JS in .rhtml templates is no go for me. Currently I made some action in controller, prepared JS code and I''m sending it via send_data as ''text/javascript''. In .rhtml templates I use <script> tag with src
2006 Jul 05
1
Need some Gruff graphing help - custom dimensions?
I''ve been working with Gruff to do all my apps graphing and such etc. I love it but I''m just having a hard time customizing the graphs, but this is perhaps due to my inability to comprehend the online RDocs. What I want to do is adjust the width / heights of my graphs or at the VERY LEAST the heights. It seems that if you scale a graph anywhere below 400-450px it is pretty
2006 Jun 05
1
Strange problem with Gruff not always displaying graph
Hello, I am having a strange problem with Gruff not always displaying the graph on the page. On some pages, the graph is displayed fine. On others, however, I just get the number relating to the id of the requested item - in my case, report. Does anyone know how to solve this problem? I have the following in my controller: def create_graph g = Gruff::Line.new(290) g.title =