Skip to content
Browse files

working!

  • Loading branch information...
1 parent e264e79 commit 9fc5442fa98f6eaeb1251418d3afad5bce733c9d @daniel-cloudspace committed Aug 18, 2011
View
5 lib/generators/devisable/devisable_generator.rb
@@ -29,7 +29,8 @@ class DevisableGenerator < Rails::Generators::Base
'extra' => [],
'new' => false,
'sudo' => false,
- 'url' => 'http://localhost:3000'
+ 'url' => 'http://localhost:3000',
+ 'jslibrary' => ''
}
@@ -94,7 +95,7 @@ def initialize(*runtime_args)
opts.on("-j", "--jslibrary (jquery|prototype)", String, "write out using the jquery or prototype libraries") do |j|
if j =~ /jquery/i
@@actual_configuration_options['jslibrary'] = 'jquery'
- else if j =~ /prototype/i
+ elsif j =~ /prototype/i
@@actual_configuration_options['jslibrary'] = 'prototype'
end
end
View
20 lib/generators/devisable/templates/partials/_permission_manage_jquery.js
@@ -2,20 +2,20 @@
* Devisable -- Permissions Edit-Add Form
* route: /roles/:id/edit
*/
-(function() {
+$(document).ready(function() {
function use_permission_clicked(obj) {
var controller = $(obj).attr('id').split('_')[1]
- var disabled_val = $(obj).is(':checked');
- $('#permission_' + controller + '_read').attr('disabled',disabled_val);
- $('#permission_' + controller + '_create').attr('disabled',disabled_val);
- $('#permission_' + controller + '_update').attr('disabled',disabled_val);
- $('#permission_' + controller + '_destroy').attr('disabled',disabled_val);
+ var disabled_val = $(obj).is(':checked')
+ $('#permission_' + controller + '_read').attr('disabled',disabled_val)
+ $('#permission_' + controller + '_create').attr('disabled',disabled_val)
+ $('#permission_' + controller + '_update').attr('disabled',disabled_val)
+ $('#permission_' + controller + '_destroy').attr('disabled',disabled_val)
}
$('.permission_manage').each(function(ind,pm) {
$('.permission_manage').click(function() {
- use_permission_clicked($(this));
- });
+ use_permission_clicked($(this))
+ })
use_permission_clicked(pm)
- });
-)
+ })
+})

0 comments on commit 9fc5442

Please sign in to comment.
Something went wrong with that request. Please try again.