./configure :
./configure --with-ruby-sitedir=~/.rvm/rubies/ruby-1.9.3-p448/lib/ruby
--prefix=`echo ~`/.rvm/rubies/ruby-1.9.3-p448
--disable-mod-activation --without-apache-libexecdir
Avec ruby1.9 et Subversion 1.8.0 :
./configure :
./configure --with-ruby-sitedir=~/.rvm/rubies/ruby-1.9.3-p448/lib/ruby
--prefix=`echo ~`/.rvm/rubies/ruby-1.9.3-p448
--disable-mod-activation --without-apache-libexecdir
Avec ruby1.9 et Subversion 1.8.0 :
✗ rails s
=> Booting WEBrick
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
*** Mocha deprecation warning: Change `require 'mocha'` to `require 'mocha/setup'`.
Exiting
StudentController#populate:
def populate
# Process:
# 1. AJAX call made by jQuery to populate the student table
# 2. Find students from the database
# 3. Pass in the student data into the helper function (construct_table_rows defined in UsersHelper)
@students_data = Student.all(:order => 'user_name',
:include => [:section,
:grace_period_deductions])
In test/functionals/groups_controller_test.rb:
should 'be able to add group without groupname' do
Assignment.any_instance.stubs(:add_group).returns(Grouping.make)
post_as @admin,
:add_group,
:assignment_id => @assignment.id
[...]
end
[Ruby 1.8.7, Rails 3.0]
I want to call annotation_categories/add_annotation_category.js.erb
with the action add_annotation_category
.
It works well with an Ajax request, but it doesn't work in my tests.
I know that the problem comes from :formats => [:html]
which should be :formats => [:js]
, but I don't understand why I have this behavior with .js.erb
and not with rjs
(I'm moving from Prototype to jQuery).
In the Controller:
For a little over two weeks, I had the opportunity to learn JavaScript by working on an issue on the MarkUs's GitHub. This issue is about updating the MarkUs application from Prototype to jQuery. Indeed, in order for MarkUs to migrate to Rails 3.1 (it is currently implemented with Rails 3.0), it has to support the new default javascript library, jQuery, hence motivating this work.
As I had never programmed in Javascript before, the first step was to document myself on javascript, but also to learn how Prototype and jQuery worked. Fortunately, these two libraries have a fairly extensive documentation (Prototype API & jQuery API).
A student, @m-bodmer had already tackled this issue a while back when working on MarkUs. Thankfully, he had created a pull request (link), and I co
$ rvm install 1.8.7 | |
Searching for binary rubies, this might take some time. | |
No binary rubies available for: osx/10.8/x86_64/ruby-1.8.7-p374. | |
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. | |
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.8.7-p374, this may take a while depending on your cpu(s)... | |
ruby-1.8.7-p374 - #downloading ruby-1.8.7-p374, this may take a while depending on your connection... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 | |
curl: (22) The requested URL returned error: 404 |
$ tar xf subversion-1.7.11.tar.gz
$ cd subversion-1.7.11
$ ./configure --with-ruby-sitedir=/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby --prefix=/usr/local/rvm/rubies/ruby-1.8.7-p374/ --disable-mod-activation --without-apache-libexecdir
$ make
$ make swig-rb
$ make install
$ make install-swig-rb
Run script.sh as:
curl -L https://gist.github.com/GhiGt/6185331/raw/26ecb9da925fbb31ce25799a30e7a889a675934a/script.sh | sudo bash
Then restart.
<script type="text/javascript"> | |
//<![CDATA[ | |
jQuery(document).ready(function() { | |
users_table = new FilterTable({ | |
[...] | |
}); | |
}); | |
new Ajax.Request('<%=populate_students_path()%>', |