Displaying 20 results from an estimated 300 matches similar to: "How do i use button_to_function"
2010 Mar 29
4
error in uploading file(help me urgnt)
when i tried to crate an upload file application in rails i am getting
error like this
Template is missing
Missing template app\views\upload\uploadfile.html.erb in view path
app/views
this is ma model
class DataFile < ActiveRecord::Base
def self.save(upload)
name = upload[''datafile''].original_filename
directory = "public/data"
# create the
2009 Dec 06
3
link_to_function or button_to_function memory usage
I have an full ajax app doing crud operations for contact info for one
section. I was using ajax calls to edit and cancel and also to add a
contact. I am implementing a button_to_function instead of doing an
ajax call to just edit/add/or cancel a contact. I am running into a
memory issue using the button_to_function or link_to_function.
I have this:
<%= link_to_function ''Edit
2007 Dec 04
2
button_to_function question
Hey everybody,
I am trying to create a button that, when clicked on, calls a method
in a controller then changes the image on the button without a page
load. I was thinking that button_to_function might be a good
contender for this but I don''t yet know how to make it talk to a
controller, and on success change the image of the button. Can anyone
help me out with this problem?
Thanks,
2009 Apr 24
2
passing a value to a js function via button_to_function
I''ve got a table of what I call resources, want to show in a jQuery
dialog a particular record when user clicks button in a row.
in the table I''m doing:
<td><%=button_to_function ''Show'',''showresource1()'',:class =>"ui-button
ui-state-default ui-corner-all", :id => resource.id %></td>
js:
<script
2009 Nov 17
6
after changed the tag i got the same eror
SyntaxError in Upload#index
Showing *app/views/upload/uploadfile.rhtml* where line *#10* raised:
compile error
app/views/upload/uploadfile.rhtml:10: syntax error
Extracted source (around line *#10*):
7: <% end %>
Trace of template inclusion: app/views/upload/uploadfile.rhtml
RAILS_ROOT: /home/malathi/www/upload
Application Trace <http://localhost:3000/upload#> | Framework
2007 May 19
4
button_to_function with image?
Hi:
does button_to_function allow the use of an image? I tried it in place
of the text with "image_tag" and it doesn''t work. Maybe some form of
button_to?
Any direction you can give would be great!
Mike
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2008 Dec 08
1
How to upload file by ajax
Hey''
How to upload file with ajax in ROR?
My code not working :(
View file :
<% form_remote_tag(:url => { :controller => ''Upload'', :action =>
''uploadFile''},
:update => "result",
:position => :bottom
:html => {:multipart => true} ) do %>
<p><label
2010 Sep 02
7
unable to upload larger files
hii,
i am trying to upload some files to filesystem using rails application
when i use small size file everything is perfect but i when goes for
larger files i got error
this is my code
#this model file
class DataFile < ActiveRecord::Base
def self.save(upload)
name = upload[''datafile''].original_filename
directory = "//192.168.147.17/Smruti/streams"
#
2009 Jul 29
6
Doubt in nil object with ajax
hi this is my htnl
<html>
<head>
<%= javascript_include_tag :defaults %>
</head>
<body>
<%= form_tag nil, { :id => ''search_form'' } %>
<%= text_field ''recipe'', ''name'' %>
<%= end_form_tag %>
<div id="recipe">
</div>
<%= observe_form :search_form, :frequency =>
2006 Aug 14
2
Change Button Text - Ajax
Hi,
I have the following code
<%= button_to_function "Hide", "Element.toggle(''mytext'');"%>
which does toggle the invisiblity of the text just fine, But want I want
via ajax magic, is to also toggle the button text, so it will now
display "Show" when I have toggled the invisiblity of the Div.
Thanks for any help.
John
--
Posted via
2010 Mar 22
7
How to reference a select_tag within a form
Hi All,
Inside my app\views\expenses\new.html.erb file, I had the code:
<% form_for(@expense) do |f| %>
[snip]
<p>
<%= f.label :vendor %><br />
<%= f.text_field :vendor %>
<br />
<div id="vendor_droplist>
<%= select_tag "test",
options_for_select(@current_vendors.collect { |v|
v.nickname }),
{:multiple
2013 Oct 27
5
run simple method from Helper on button click
Greetings,
I''m new to rails and currently having couple problems about how to add
javascript functionality into rails.
I have a simple method in the helper and i want to run this code on
button click.
------------------------------------------------------------------
module PagesHelper
def show_message
"simple output"
end
end
2008 Jul 09
1
render file in index
Hi
I am trying to render file in controller like this :
def index
render :flie => ''app\views\upload\uploadfile.html.erb''
end
It still complains that template is missing.
Template is missing
Missing template upload/index.html.erb in view path /home/rails/
directory/app/views
Do i have to use funtion render :template or how i can change that
default index.html.erb
2006 Jan 06
4
Upload Progress Bar Problems
I''m writing an application where the user will be uploading many images
and user feedback is essential.
I''ve been trying to get the upload progress bar plug-in to work, but
thus far have not had any success.
I''ve downloaded Sean Treadway''s application code from his site
http://sean.treadway.info/demo/upload/ and I followed the steps in his
Upload
2018 Sep 06
3
How to add Loongson ISA for Mips target?
Hi LLVM developers,
GCC[1] is able to use Loongson ISA[2] for instruction selection:
$ cat hello.c
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello World\n");
return 0;
}
$ gcc -O0 -S hello.c
$ cat hello.s
.file 1 "hello.c"
.section .mdebug.abi64
.previous
.nan legacy
.gnu_attribute 4, 1
.abicalls
2006 Jul 21
10
Using an image button for "link_to_remote"
All,
I want to do an AJAX request using a custom image button. I currently
have this as a standard button action using "button_to".
What I need is the button equivalent of "link_to_remote". Is there a
helper that I can use, or do I need to build it by hand?
I see button_to_function(), but that sets me up to call a Javascript
function, not post to a Rails action.
Or can
2007 Oct 24
0
STI vs CTI vs something else?...
Hey gang,
I have these classes:
class Image < UploadFile
validates_file_format_of :filename, :in => ["gif", "png", "jpg"]
end
class UploadFile < PropertyItem
file_column :filename
validates_presence_of :filename
end
class PropertyItem < ActiveRecord::Base
validates_presence_of :name
end
What I''m trying to achieve is a class
2006 Jul 13
5
Does Javascript let you default input params like Ruby does?
Can you have a Javascript function with a param that''s defaulted if it
isn''t present?
function X(a, b = false, c = ''dog'') {
}
X(5) calls X with a=5, b=false, c=''dog''
X(4, true) calls X with a=4, b=true, c=''dog''
X(3, true, ''cat'') calls X with a=3, b=true, c=''cat''
?
--
Posted via
2013 Sep 30
0
TypeError: no implicit conversion of Symbol into Hash when submitting form to upload files
I''m currently new to Rails and Ruby and I''m trying to learn from my
mistakes, this time I''m trying to upload 2 files from a form for later
processing, however, after I hit the "Submit" button. I keep getting this
error:
TypeError in UploadFilesController#create
app/controllers/upload_files_controller.rb:28:in `new''
2018 Sep 06
2
How to add Loongson ISA for Mips target?
- my old email address.
The ISA_* classes might not be the best choice for this. There's an overall hierarchy and ordering to the ISA_* classes since they represent the generations of the MIPS ISA. If these extensions are available in Loongson chips based on MIPS32r1 and MIPS32r2 for example, it becomes difficult to describe with ISA_* classes without duplicating instruction definitions or