Ruby Sequel Web Application

Finally im able to create a simple web application using ruby with sinatra,sequel, postgres.

Please download from link below and extract it

webappruby

this sample using postgresql database with a table , userlogin to store user and password.

CREATE TABLE userlogin
(
 id bigserial primary key,
 userid text NOT NULL,
 passwd text NOT NULL,
 fullname text NOT NULL,
 email text NOT NULL DEFAULT ''::text,
 active text DEFAULT 'Y'::text

);

insert into userlogin ( userid,passwd,fullname) 

select 'admin','admin','administrator';

to start the web app do as follow

web server is listening on port 4567

fire up your browser to localhost:4567

after login success will go to home page

change password screen is simple

We can run it on jruby too. On jruby install pg_jruby gem instead of pg/postgres gem. And also dont forget to install puma gem too.

thats it !

good night ….

Selamat Hari Raya.

Leave a Reply

Your email address will not be published. Required fields are marked *