Installation Active Admin is a Ruby Gem. gem 'activeadmin' More accurately, it's a Rails Engine that can be injected into your existing Ruby on Rails application. Setting up Active Admin After installing the gem, you need to run the generator. By default we use Devise, and the generator creates an AdminUser model. If you want to create a different model (or modify an existing one for use with Devise) you can pass it as an argument. If you want to skip Devise configuration entirely, you can pass --skip-users . rails g active_admin:install # creates the AdminUser class rails g active_admin:install User # creates / edits the class for use with Devise rails g active_admin:install --skip-users # skips Devise install The generator adds these core files, among others: app/admin/dashboard.rb app/assets/javascripts/active_admin.js.coffee app/assets/stylesheets/active_admin.css.scss config/initializers/active_admin.rb Now, ...
<html> <head> <title>Two textbox, when enter data in one textbox, it appears in second textbox</title> <link rel="stylesheet" type="text/css" href="style.css"> /<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ //Addition $("#add").click(function(){ var a = $("#cal1").val(); var b = $("#cal2").val(); $("#result").val(+a + +b); }); //Subtraction $("#sub").click(function(){ var a = $("#cal1").val(); var b = $("#cal2").val(); $("#result").val(+a - +b); }); //Multiplication $("#mul").click(function(){ var a = $("#cal1").val(); v...
What is Armstrong Number?? An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371. Armstrong Number Program in Ruby #!/usr/bin/ruby class Armstrong puts "Enter a number" number=STDIN.gets.to_i sum=0 d=number while (d!=0) sum=sum+(d%10)*(d%10)*(d%10) d=d/10 end if(sum==number) puts "your number is Armstron...
Thanq Mr.Kiran
ReplyDelete