Skip to content

Instantly share code, notes, and snippets.

doctype html
html
head
meta content='text/html; charset=UTF-8' http-equiv='Content-Type'
body
p Dear #{@user.name},
p Welcome to the WorkTies Recruitment platform. We are excited that you have chosen us and want to ensure that you obtain the candidates you seek. Below is a quick link to your dashboard, the portal to all your job posts and matches. Do reach out if you have any questions.
store = $page.store
job = Job.new
job._name = 'Test'
puts job
puts job._name
store._jobs << job
puts store._jobs
google = Company.new({
name: 'Google',
url: 'www.google.com',
desc: 'Leading Search Engine',
public_at: 2004
})
store._companies << google
job = Job.new
job.company = google
# this errors out
class Job < Volt::Model
validate :title, unique: true
belongs_to :company
def recommendations(user)
store._jobs.limit(10).fetch
end
<:bootstrap_carousel:main slides="{{ recommendations(user) }}" />
# inside bootstrap_carousel component
{{ attrs.slides.each_with_index do |recommendation, index| }}
<div class='background-vms'>
<a class='btn btn-default' e-click='search'>Show</a>
{{ if searched }}
<ul class='search-results'>
<!--{{ _results.each do |item| }}-->
<li>
<img src='assets/images/card.png' />
</li>
<!--{{ end }}-->
<div class='background-vms'>
<a class='btn btn-default' e-click='search'>Show</a>
{{ if _searched }}
<ul class='search-results'>
<!--{{ _results.each do |item| }}-->
<li>
<img src='assets/images/card.png' />
</li>
<!--{{ end }}-->
<:carousel results="{{ _results }}" name="home-carousel"></:carousel>
<:Carousel>
<div id="{{ attrs.name }}" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
{{ attrs.results.each_with_index do |recommendation, index| }}
<li data-target="#{{ attrs.name }}" data-slide-to="{{ index }}" class="{{ if index == 0 }}active{{ end }}"></li>
{{ end }}
</ol>
reactive_accessor :search_results
@computation = -> {
if page._search.present?
puts "searching with #{page._search}"
SearchTasks.job_fulltext_search(page._search).then do |results|
self.search_results = results
end
end
Thin web server (v1.6.3 codename Protein Powder)
Maximum connections set to 500
Listening on 0.0.0.0:3000, CTRL+C to stop
/Users/penn/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/volt-0c7d5e622931/lib/volt/server/message_bus/peer_to_peer.rb:121:in `block (2 levels) in connect_to_peers': undefined method `_ips' for nil:NilClass (NoMethodError)
/Users/penn/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/volt-0c7d5e622931/lib/volt/server/message_bus/peer_to_peer.rb:121:in `block (2 levels) in connect_to_peers': undefined method `_ips' for nil:NilClass (NoMethodError)
Unexpected error while processing request: drbunix:/var/folders/pw/l0w0lnkx72vb82bhfv6hn9y00000gn/T/druby57145.0 - #<Errno::ENOENT: No such file or directory - connect(2) for /var/folders/pw/l0w0lnkx72vb82bhfv6hn9y00000gn/T/druby57145.0>
/Users/penn/.rbenv/versions/2.2.0/lib/ruby/2.2.0/drb/drb.rb:744:in `rescue in block in open'
/Users/penn/.rbenv/versions/2.2.0/lib/ruby/2.2.0/drb/drb.rb:738:in `block in open'