Skip to content

Commit 9a5b683

Browse files
Merge pull request #18 from JaiChandran01/SampleRuby-SF5269
This message contains the changes of the Ruby-Sample File.
2 parents da6a559 + 818d40b commit 9a5b683

7 files changed

Lines changed: 85 additions & 36 deletions

File tree

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
ruby "3.2.2"
55

66
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7-
gem "rails", "~> 7.0.6"
7+
gem "rails", "~> 8.1.2"
88

99
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
1010
gem "sprockets-rails"
1111

1212
# Use sqlite3 as the database for Active Record
13-
gem "sqlite3", "~> 1.4"
13+
gem "sqlite3", "~> 2.9.0"
1414

1515
gem 'webpacker', '~> 5.x.x'
1616

1717
# Use the Puma web server [https://github.com/puma/puma]
18-
gem "puma", "~> 5.0"
18+
gem "puma", "~> 7.2.0"
1919

2020
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
2121
gem "importmap-rails"

Output.png

27.8 KB
Loading

Output/output.png

27.8 KB
Loading

README.md

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,71 @@
1-
# javascript-scheduler-ruby-rails-application
1+
<!--
2+
howto.md
3+
A step-by-step guide to integrate Ruby on Rails with Syncfusion TS Scheduler
4+
-->
5+
# How to Integrate Ruby on Rails with Syncfusion Scheduler
6+
This repository contains a sample full-stack application demonstrating how to display events in syncfuison Scheduler component using Ruby on Rails.
27

38
## Prerequisites
9+
- Ruby - (3.2.2)
10+
- Node JS - (>=18.13.0)
11+
- Yarn - (>=1.22.19)
412

5-
Ruby - 3.2.2
6-
Node Js - 18.13.0
7-
Yarn - 1.22.19
8-
9-
## Ruby setup
10-
11-
You can install the Ruby from the following link.
12-
[`https://www.ruby-lang.org/en/downloads/`](https://www.ruby-lang.org/en/downloads/)
13-
14-
## Install Rails
15-
13+
## Project Structure
1614
```
17-
gem install rails
15+
├── README.md # This guide
16+
├── postcss.config.js
17+
├── package.json
18+
├── test #Testing the functionality
19+
│ ├── events_controller_test.rb
20+
│ ├── schedule_controller_test.rb
21+
└── app
22+
├── javascript #Main JavaScript entry point that initializes frontend behavior
23+
│ ├── application.js
24+
│ ├── controllers
25+
│ │ ├── index.js
26+
└── views
27+
├── layouts
28+
│ ├── application.html.erb #Base HTML layout wrapping all views
29+
└── welcome
30+
└── index.html.erb # View template for the welcome page
1831
```
1932

20-
## Add Syncfusion Scheduler component in your application
33+
## Project Setup
34+
## Installation
35+
1. ### Clone the project
36+
Clone the project from the repository by creating a fork and branch.
37+
2. ### Ruby setup
38+
You can install the Ruby from the following link.
39+
[`https://www.ruby-lang.org/en/downloads/`](https://www.ruby-lang.org/en/downloads/)
40+
Then Install gem using below commands
41+
```
42+
gem install rails
43+
```
44+
3. ### Install dependencies:
45+
```bash
46+
npm install
47+
or
48+
yarn install
49+
```
50+
### Running the Application
51+
1. Navigate to javascript-scheduler-ruby-rails-application folder.
52+
```bash
53+
cd javascript-scheduler-ruby-rails-application
54+
```
55+
2. Start the Scheduler Frontend
56+
```bash
57+
rails server
58+
```
59+
3. Navigate to `http://localhost:3000` in your browser. (or) Ctrl + click the link in your terminal
2160
22-
Refer the following UG documenation for adding Syncfusion React component in your application
23-
* [Getting Started of Syncfusion Javascript Scheduler component](https://ej2.syncfusion.com/javascript/documentation/schedule/getting-started)
2461
25-
## Run the project
62+
## Output
63+
![Frontend Preview](./Output/output.png)
2664
27-
```
28-
yarn install
29-
rails server
30-
```
65+
## Troubleshooting
66+
- **Version error**: Check and install the current version as by prerequistes.
67+
- **Port already in use**: Clear all the previous running applications in both browser and command prompt.
68+
69+
## Liscense
70+
**License banner**: Obtain and register a Syncfusion license key [link](https://ej2.syncfusion.com/angular/documentation/licensing/overview).
71+

app/views/welcome/index.html.erb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<section>
2-
<script src="https://cdn.syncfusion.com/ej2/22.1.38/dist/ej2.min.js" type="text/javascript"></script>
3-
<link href="https://cdn.syncfusion.com/ej2/22.1.38/material.css" rel="stylesheet">
2+
<script src="https://cdn.syncfusion.com/ej2/32.1.24/dist/ej2.min.js" type="text/javascript"></script>
3+
<link href="https://cdn.syncfusion.com/ej2/32.1.24/material.css" rel="stylesheet">
44
</section>
55
<section>
66
<div id="Schedule"></div>
77
<script>
88
var scheduleObj = new ej.schedule.Schedule({
99
height: '550px',
1010
width: '100%',
11-
selectedDate: new Date(2023, 6, 13),
11+
selectedDate: new Date(2026, 0, 22),
1212
eventSettings: {
1313
dataSource: [{
14-
id: 1,
15-
subject: 'Meeting',
16-
startTime: new Date(2023, 6, 13, 10, 0),
17-
endTime: new Date(2023, 6, 13, 12, 30)
14+
Id: 1,
15+
Subject: 'Meeting',
16+
StartTime: new Date(2026, 0, 22, 10, 0),
17+
EndTime: new Date(2026, 0, 22, 12, 30)
1818
}]
1919
}
2020
});
2121
scheduleObj.appendTo('#Schedule');
2222
</script>
23-
</section>
23+
</section>

config/environments/development.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,12 @@
6767

6868
# Uncomment if you wish to allow Action Cable access from any origin.
6969
# config.action_cable.disable_request_forgery_protection = true
70+
Rails.application.configure do
71+
# ...other settings...
72+
73+
# Force Sprockets to keep its cache in memory in dev
74+
config.assets.configure do |env|
75+
env.cache = Sprockets::Cache::MemoryStore.new
76+
end
77+
end
7078
end

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"dependencies": {
33
"@rails/webpacker": "5.4.4",
4-
"@syncfusion/ej2-schedule": "^22.1.38",
5-
"webpack": "^5.88.0",
6-
"webpack-cli": "^5.1.4"
4+
"@syncfusion/ej2-schedule": "*",
5+
"webpack": "^5.104.1",
6+
"webpack-cli": "^6.0.1"
77
},
88
"devDependencies": {
9-
"webpack-dev-server": "^5.2.1"
9+
"webpack-dev-server": "^5.2.3"
1010
}
1111
}

0 commit comments

Comments
 (0)