[Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Sebastian
OK, it looks like that JRails is better for dealing with Rails2, but not for Rails3! So there is only one question left: If a install the "jquery-rails" gem like you mentioned, are the prototype helpers still working? Right now I am using your code in html tags and it is working like a charm, lik

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Sebastian
Thank you for your detailed answer! I started with Rails 3, so there is no "old" Rails 2 code in it. As I know Rails 3 comes out-of-the-box configured with prototype, right? So yes I have prototype installed. And yes you are right I meant javascript helpers (not JAVA), like this: <%= button_to 'D

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread radhames brito
> > > google to your Gemfile and at this > > should be 'move to your gem file', it appear i was making honor to my motto: cogito ergo google -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread radhames brito
On Tue, Oct 25, 2011 at 4:14 AM, Sebastian wrote: > Ah, I found my mistake!!! > > I was just only adding JQuery in my view with <%= > javascript_include_tag "http://code.jquery.com/jquery-latest.js"; %>, > but not in my application.html.erb. That means that the code in the > application.js had pro

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Sebastian
Ah, I found my mistake!!! I was just only adding JQuery in my view with <%= javascript_include_tag "http://code.jquery.com/jquery-latest.js"; %>, but not in my application.html.erb. That means that the code in the application.js had propably no JQuery access! My problem now is that my other norma

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Roy Situmorang
Well, could you paste your HTML code here? On Tue, Oct 25, 2011 at 1:58 PM, Sebastian wrote: > First, thank you all for your answers!!! > > I removed the typo and did what you told me! The firebug console is > finding the $(".show1") and it is hiding the row if I type $ > (".show1") .hide() > > S

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Sebastian
First, thank you all for your answers!!! I removed the typo and did what you told me! The firebug console is finding the $(".show1") and it is hiding the row if I type $ (".show1") .hide() So I tried your example with the log output, but Firebug says me "$ (document).ready is not a function" My

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread radhames brito
On Mon, Oct 24, 2011 at 10:56 AM, Walter Lee Davis wrote: > > On Oct 24, 2011, at 10:50 AM, Roy Situmorang wrote: > > > I'm sorry for the typo, I have just fixed the code as follow: > > > > (function() { > > $("#filters input:checkbox").click( > > function(){ > >class_to_show = $(this).attr(

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Walter Lee Davis
On Oct 24, 2011, at 10:50 AM, Roy Situmorang wrote: > I'm sorry for the typo, I have just fixed the code as follow: > > (function() { > $("#filters input:checkbox").click( > function(){ >class_to_show = $(this).attr("id"); > switch(class_to_show){ > case 'show1': > $(".show1"

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Roy Situmorang
I'm sorry for the typo, I have just fixed the code as follow: (function() { $("#filters input:checkbox").click( function(){ class_to_show = $(this).attr("id"); switch(class_to_show){ case 'show1': $(".show1").show(); $(".show2").hide(); break; case 'show2':

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Roy Situmorang
I'm sorry, I have just fixed the code as follow: (function() { $("#filters input:checkbox").click( function(){ class_to_show = $(this).attr("id"); switch(class_to_show){ case 'show1': $(".show1").show(); $(".show2").hide(); break; case 'show2': $(".show

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Walter Lee Davis
On Oct 24, 2011, at 10:25 AM, Sebastian wrote: > EDIT: The error is in the line after the "default" > > On 24 Okt., 16:23, Sebastian wrote: >> With the modified code, Firebug gives me that error: >> missing : after case label >> $(".show1").show(); >> >> Code in application.js looks like this

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Sebastian
EDIT: The error is in the line after the "default" On 24 Okt., 16:23, Sebastian wrote: > With the modified code, Firebug gives me that error: > missing : after case label > $(".show1").show(); > > Code in application.js looks like this now: > > (function() { > $("#filters input:checkbox").click(

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Sebastian
With the modified code, Firebug gives me that error: missing : after case label $(".show1").show(); Code in application.js looks like this now: (function() { $("#filters input:checkbox").click( function(){ class_to_show = $(this).attr("id"); switch(class_to_show){ case 'show1':

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Walter Lee Davis
On Oct 24, 2011, at 8:53 AM, Sebastian wrote: > Yes you are right! Yours is looking better! > > But I am not getting it to work! > > I have now the followinfg in my public/javascripts/application.js: > > $("#filters input:checkbox").click(function(){ > class_to_show = $(this).attr("id"); >

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Roy Situmorang
Try this modified code: (function() { $("#filters input:checkbox").click( > > function(){ >class_to_show = $(this).attr("id"); > switch(class_to_show){ > case 'show1': > $(".show1").show(); > $(".show2").hide(); > break; > case 'show2': > $(".show1").hid

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-24 Thread Sebastian
Yes you are right! Yours is looking better! But I am not getting it to work! I have now the followinfg in my public/javascripts/application.js: $("#filters input:checkbox").click(function(){ class_to_show = $(this).attr("id"); switch(class_to_show){ case 'show1': $(".show1")

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-23 Thread Sebastian
I tried the following without success: <%= check_box_tag 'Filter A', @filter1, :onClick => "$ (this).is(':checked') && $(this.value).addClass('hidden') || $ (this.value).removeClass('hidden');" %> On 21 Okt., 18:31, Tim Shaffer wrote: > Have a look at the documentation for check_box_tag > > http

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-21 Thread Tim Shaffer
Have a look at the documentation for check_box_tag http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-check_box_tag It specifies that any other keys passed to options will be used as HTML attributes. So you can pass your onclick attribute to check_box_tag in the o