I'm sure you checked this but just in case... based on what you just
said, check to make sure you haven't disabled JS in your browser.
Put a "Hello World" script in Application.js
I'm using jQuery in Rails 3 with Ruby 1.9.2 and it's working fine:
I use <%= javascript_include_tag :default %> with :default defined as
config.action_view.javascript_expansions[:defaults] =
%w(jquery.min rails jquery-ui.min)
in my application.rb file.
HTH,
Dan
On Dec 16, 3:07 pm, loominator1970 <[email protected]> wrote:
> Nope, nothing in the application.js file. Checked the firebug output
> and there is nothing. The JS is not even getting fired, which make no
> sense because I have the ':remote => true' statement in there. It
> even creates the 'data-remote' call in the HTML output (see below). I
> thought that was the key to UJS in Rails3?
>
> <form accept-charset="UTF-8" action="/course/
> remove_student_from_course" data-remote="true" method="post"><div
> style="margin:0;padding:0;display:inline"><input name="utf8"
> type="hidden" value="✓" /><input name="authenticity_token"
> type="hidden" value="4uzcKHN73cndlQENeb7IWRhe6g0F5eFZG91y3ACWO0M=" /></
> div>
> <input id="course_id" name="course_id" type="hidden"
> value="1529" />
> <input id="student_id" name="student_id" type="hidden"
> value="437" />
> <input class="submitLink" name="commit" type="submit"
> value="Remove" />
> </form>
>
> On Dec 16, 1:34 am, Ray Parker <[email protected]> wrote:
>
> > Do you have anything pertinent/related/involved in the application.js
> > file? Try pulling that out as you could be having a failure in JS
> > that's causing grief. Also -- check your console in Firebug (or
> > whatever you're using) and see if errors are being thrown when the
> > page loads.
>
> > On Dec 16, 1:19 am, loominator1970 <[email protected]> wrote:
>
> > > Yep, i've done that, too. Here's the header of the 'rails.js' version
> > > i'm using
>
> > > /*
> > > * jquery-ujs
> > > *
> > > *http://github.com/rails/jquery-ujs/blob/master/src/rails.js
> > > *
> > > * This rails.js file supports jQuery 1.4.3 and 1.4.4 .
> > > *
> > > */
>
> > > On Dec 15, 11:08 pm, Rob Biedenharn <[email protected]>
> > > wrote:
>
> > > > On Dec 16, 2010, at 12:48 AM, loominator1970 wrote:
>
> > > > > Yes I am, here's what I have in the application.html.erb view, and
> > > > > they are all in my javascript folder
>
> > > > > <%= javascript_include_tag 'jquery-1.4.3.js', 'rails', 'application'
> > > > > %>
>
> > > > Ah, but have you replaced rails.js with the jquery version?
>
> > > > curl -Ohttps://github.com/rails/jquery-ujs/raw/master/src/rails.js
>
> > > > see the README athttp://github.com/rails/jquery-ujsformoredetails.
>
> > > > -Rob
>
> > > > > On Dec 15, 10:30 pm, Ray Parker <[email protected]> wrote:
> > > > >> Are you including rails.js?
>
> > > > >> On Dec 16, 12:16 am, loominator1970 <[email protected]> wrote:
>
> > > > >>> This seems like it should be pretty straightforward, but its
> > > > >>> stumping
> > > > >>> me. I have a small form that I am trying to submit using jquery
> > > > >>> that
> > > > >>> is supposed to remove an association between to HABTM models. For
> > > > >>> the
> > > > >>> sake of argument, the models are Course and Student.
>
> > > > >>> # view
> > > > >>> <%= form_tag ( remove_student_from_course_path, :remote =>
> > > > >>> true )
> > > > >>> %>
> > > > >>> <%= hidden_field_tag "course_id", @course.id %>
> > > > >>> <%= hidden_field_tag "student_id", @student.id %>
> > > > >>> <%= submit_tag 'Remove' %>
>
> > > > >>> # controller
> > > > >>> def remove_student_from_class
> > > > >>> @student = Student.find(params[:student_id])
> > > > >>> @msg = Factor.method_to_remove_student_from_class(params)
>
> > > > >>> respond_to do |format|
> > > > >>> format.html { redirect_to edit_class_path(@class) }
> > > > >>> format.js
> > > > >>> end
> > > > >>> end
>
> > > > >>> # remove_student_from_class.js.erb
> > > > >>> // reload the page
> > > > >>> location.reload();
>
> > > > >>> Everything works fine, except the HTML code is generated and not the
> > > > >>> JS code in the respond_to block. I would expect the JS call to get
> > > > >>> fired since I have the ':remote => true' line in there, but its
> > > > >>> always
> > > > >>> the HTML and it generates the page. What am I overlooking?
>
> > > > >>> Dave
>
> > > > Rob Biedenharn
> > > > [email protected] http://AgileConsultingLLC.com/
> > > > [email protected] http://GaslightSoftware.com/
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.