This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This goes in the application controller | |
before_action :set_locale | |
def set_locale | |
if current_user and current_user.locale | |
I18n.locale = current_user.locale[0..1] | |
else | |
if session[:lang] | |
I18n.locale = session[:lang] | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/voltrb/volt#routes for more info on routes | |
# Routes for login and signup, provided by user-templates component gem | |
get '/signup', _controller: 'user-templates', _action: 'signup' | |
get '/login', _controller: 'user-templates', _action: 'login' | |
# The main route, this should be last. It will match any params not | |
# previously matched. | |
get '/', {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By default Volt generates this controller for your Main component | |
class MainController < Volt::ModelController | |
model :store | |
def index | |
end | |
def send_message | |
unless page._new_message.strip.empty? | |
_messages << { sender_id: Volt.user._id, receiver_id: params._user_id, text: page._new_message } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<:Title> | |
{{ template main_path, "title", {controller_group: 'main'} }} | |
<:Body> | |
<div class="container"> | |
<div class="header"> | |
<ul class="nav nav-pills pull-right"> | |
<:nav href="/" text="Home" /> | |
<:user-templates:menu /> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<:Title> | |
Home | |
<:Body> | |
<h1>Home</h1> | |
{{ if Volt.user }} | |
<div class="row"> | |
<div class="col-md-4"> | |
{{ _users.each do |user| }} | |
{{ if user._id != Volt.user._id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.conversation{ | |
form{ | |
input{ | |
margin: 10px 0 5px 0; | |
} | |
} | |
} | |
.contact{ | |
width:100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.conversation{ | |
form{ | |
input{ | |
margin: 10px 0 5px 0; | |
} | |
} | |
} | |
.contact{ | |
width:100%; |