Skip to content

Commit

Permalink
Added a Basic Phlex component
Browse files Browse the repository at this point in the history
  • Loading branch information
yatish27 committed May 21, 2024
1 parent e125160 commit 11eda51
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ GEM
factory_bot (~> 6.4)
railties (>= 5.0.0)
foreman (0.88.1)
fugit (1.9.0)
fugit (1.10.1)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
globalid (1.2.1)
Expand Down Expand Up @@ -201,7 +201,7 @@ GEM
puma (6.4.2)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.7.3)
racc (1.8.0)
rack (3.0.11)
rack-proxy (0.7.7)
rack
Expand Down Expand Up @@ -283,11 +283,11 @@ GEM
rubocop-rails
ruby-progressbar (1.13.0)
smart_properties (1.17.0)
solid_queue (0.3.0)
solid_queue (0.3.1)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (~> 1.2.2)
fugit (~> 1.9.0)
fugit (~> 1.10.1)
railties (>= 7.1)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
Expand Down
9 changes: 9 additions & 0 deletions app/views/components/basic_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class BasicComponent < ApplicationComponent
def initialize(version:)
@version = version
end

def view_template(&)
p(class: "text-lg text-gray-600") { "Hello from Phlex #{@version} 💪🏼" }
end
end
3 changes: 2 additions & 1 deletion app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<%= vite_image_tag("images/logo-sm.png", class: "h-12 w-12 rounded-full") %>
<h1 class="scroll-m-20 text-4xl font-bold tracking-tight">Shore</h1>
</div>
<p class=" text-lg text-gray-600">An opinionated and modern Ruby on Rails template with pragmatic defaults to start your next project 🚀</p>
<p class=" text-lg text-gray-600">A modern Ruby on Rails template with production ready recommended defaults to start your next project 🚀</p>
<p class="text-lg text-gray-600 mt-6">
Stimulus says,
<i class="text-indigo-600" data-controller="hello">Stimulus not loaded 😥</i>
</p>
<%= render BasicComponent.new(version: Gem.loaded_specs["phlex"].version.to_s) %>
</div>
</div>
6 changes: 1 addition & 5 deletions bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
PORT="${PORT:-3000}"
export PORT

if command -v overmind &> /dev/null; then
overmind start -f Procfile.dev "$@"
else
foreman start -f Procfile.dev "$@"
fi
foreman start -f Procfile.dev "$@"

0 comments on commit 11eda51

Please sign in to comment.