Displaying 20 results from an estimated 70000 matches similar to: "field is not empty rails javascript"
2006 Aug 12
7
Override method in ActiveRecord
Hello,
there is a method ActiveRecord::Base#exists? . I would like to override
this method in a class ActiveRecord.
Could anyone tell me how to do it?
TIA
--
Posted via http://www.ruby-forum.com/.
2006 Mar 30
13
Trying Agile book, found problem
Pg. 57 of Agile asks you to create a scaffolding by typing in
ruby script/generate scaffold Product Admin
Instead of generating everything, it only gives me
exists app/controllers/
exists app/helpers/
exists app/views/admin
exists test/functional/
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical
2011 Jul 23
0
Rendering of Javascript updates with Rails > 2.1
Hey,
i am currently upgrading a Rails 2.1 app to 2.3 to benefit from Rails
engines.
The app requires rendering javascript updates to strings, which does
not work
with 2.3 anymore:
data =
ActionView::Base.new(Rails::Configuration.new.view_path).render(:update)
do |page|
page["div[id=''foo'']"].removeClass("bar")
end
whihc results in an error because the
2011 Mar 14
1
Javascript & Rails future
Hi,
David H.H. announced recently that jquery is going to be the default in Rails 3.1, and that Prototype helpers / RJS are going into a gem.
What does that mean for the future? Should we progressively forget about things like javascript helpers, RJS, and all these fun parts of rails? And start coding with jquery/json in mind?
I''m not against that at all, but I have to admit I find RJS
2006 Jul 23
0
How to pass a javascript variable to ruby variable
Hi,
I am trying to integrate a javascript text editor in a ROR app and I
have the following dificulty.
The text typed into the JS editor can be saved in variable E in html
format. I need to pass this to a ruby variable to (say x) in the
controller.
Any ideas on a clean way this may be done ?
A though I had was creating a non visible textbox (using say a ROR
helper) and assigning the text
2006 Apr 28
3
how to do form field validation using javascript in rubyonrails
hi all
can any body tell me how to javascript validation in ruby on rails
for form field
thnx in advance
2006 Mar 20
3
rhtml templates and syntax
Hello,
where do we need <% -%> in templates ? What is the difference between
<%= %> and it ?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 02
4
Instance variables in Javascript param
How can I make this work ?
<a href="#" onclick="new Effect.Fade(@div_id)"></a>
@div_id is an instance variable ?
TIA
--
Posted via http://www.ruby-forum.com/.
2006 Aug 01
0
Unobtrusive Javascript for Rails 0.2
Dan Webb (http://www.vivabit.com) and I are happy to announce the
latest release of the Unobtrusive Javascript plugin for Rails. This
release packs in lots of cool new features, a few changes to old ones
and some performance enhancements.
Now you can write your behaviours in Ruby, attach behaviours directly
to elements using content_tag and apply behaviours to elements
without HTML IDs.
2007 Jul 03
2
"form_for" names fields using brackets = javascript problems
Hi all,
The "form_for" helper and its friends "text_field_for" etc generate form
fields with names like "forum[title]", i.e. using square brackets to
denote attributes on model objects.
Now, for the convenience of the user I want to do some simple
client-side validation to check that some fields have been filled in. So
I am trying to write javascript like
"if
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select
field, such as
<%= collection_select("job", "client_id" , @clients, "id", "name") %>
with onChange="xxx"
Anyone know how to make this work?
Thank you,
Scott
--
Posted via http://www.ruby-forum.com/.
2006 Mar 05
7
whatever happend to unobtrusive javascript in Rails ?
Don''t get me wrong, JavaScript/Ajax helpers in Rails are a huge
timesaver and they have helped me to finally overcome my irrational
aversion to js libraries like prototype and such. However, all this
goodness seems to come at quiet a price. The resulting code is
littered with inline JS, including ubiquitous script tags and onload
attributes etc.. It seems that just when i found
2006 Jul 05
0
Javascript repeating fields.
The one area I keep hitting my head against in Rails is repeating fields via
javascript. I frequently have forms where one or more fields are actually
broken out into sub tables because there can be multiple simultaneous values.
Rails seems to want to you to use the [] construct in the form helpers (e.g.
text_field(''employee[]'', ''name'')), but I can''t
2006 Jan 16
0
Specifying Javascript events for form fields
So forgive the stupid question, I''m a relative Rails newby. I have a form
that I would like to submit each time the user changes their selection in
one of several select items (single selection only).
I''ve got this behavior working properly in the select_tag method, but I also
have two other fields on the form - a month and a year. The month and year
tags are created using the
2010 Aug 14
0
[rails3.0.0.beta4] extend form_tag to always include a hidden field
hi there,
I want every form in the site to add a hidden_field, basically I want them
to always submit the I18n.locale, I''ve tried to alias form_tag_html method
of ActionView::Helpers::FormTagHelper like this:
# in #{MY_APP_ROOT}/lib/action_view/helpers/form_tag_helper.rb
module ActionView::Helpers::FormTagHelper
def form_tag_html_with_locale(html_options)
form =
2006 May 31
1
Problem with combining rails helper and javascript
Hi!
I''d like to make ajax request after effect fade finishes. There''s a
callback in Effect class - afterFinish, but it requires the code to be
in function() {*here*}.
When i write :afterFinish => remote_function() it generates following
javascript code:
afterFinish: new Ajax.Updater()
and i need:
afterFinish: function() {new Ajax.Updater()}
How can i do it? I need to
2006 Jun 05
1
Unobtrusive javascript...what if?
What if...you could produce accessible, unobtrusive javascript, using
Rails built-in javascript/prototype helpers, with just one extra line
of code in your layout, a plugin, and one small enhancement to the
helpers. Something like this:
[php]
<% form_remote_tag :controller => ''foo'', :action => ''bar'',
:unobtrusive => true %>
# which produces
2006 Mar 25
2
Current controller
Hello railists,
I have a list of news headers on my index page. I would like to hide
this list if current controller is ''news''.
I put to main/index.rhtml
"<% unless @controller == "news" %> list here news headers <% end %>
. This doesn''t work.
So, the question is how to get current controller name in template ?
Thank You!
--
Posted via
2009 Oct 29
0
Javascript in text field with autocomplete
If I am using the autocomplete plugin, and I have a text field
specified in a form that incorporates autocomplete, such as:
<%=
text_field_with_auto_complete :doctor, :organization, :autocomplete =>
"off" %>
how can I put javascript event handlers to if (e.g. keypress,
onchange, etc.) ? WHat I really want to do is call a method in my
controller if either:
1. The text field is
2006 Jul 20
6
replace_html + javascript
Hi all,
This is my first post to the list, so I hope it gets through and I
don''t do anything wrong :)
Here''s the issue I''m having...
I have an rjs that''s doing:
page.replace_html ''myid'', :partial => ''my_partial''
And in my my_partial I have:
<script type="text/javascript">