When I enabled the turbolinks in my rails app, some of the content layout been affected and not aligned properly. But if I refresh the page then the content is aligned properly.
After adding turbolinks,
remove below Two link in views/applicatios.html.erb
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
it works for me..
Related
I'm trying configure the devise gem on my application built in Rails 5.2.
After install devise and create the views I'm get this error
The asset "devise/sessions.css" is not present in the asset pipeline.
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag params[:controller], media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag params[:controller], 'data-turbolinks-track': 'reload' %>
That was raised on line #9.
I've already created this file on my app/assets folder and setted on my assets.rb file like this:
Rails.application.config.assets.precompile += %w( addresses.css
welcome.css
donations.css
givers.css
sessions.css
scaffolds.css)
and this:
Rails.application.config.assets.precompile += %w( addresses.css
welcome.css
donations.css
givers.css
devise/sessions.css
scaffolds.css)
But I continue receiving the same error.
I have no more ideias what to do to solve my problem, someone could help me, please?
I'm following this answer about using yarn to set up semantic-ui with rails but get this vague error that says only Unrecognised input whenever I access localhost. The stack trace is short and the only clue it provides is to the stylesheet and javascript link tags in my application.html.erb head:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
What does Unrecognised input mean, and what causes it?
who would win? many lines of code or one missing semicolon?
make sure you end your variable declarations with a semicolon.
I am having this error. I have already installed nodejs and also added gem'therubyracer'.
ActionView::Template::Error (SyntaxError: [stdin]:21:3: unexpected ():
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb__3921329476922966565_70164612108380'
However, after I add this block of code in my rooms.coffee file, I get the error:
$('#new_message').submit(e) ->
$this = $(this)
textarea = $this.find('#message_body')
if $.trim(textarea.val()).length > 1
App.global_chat.send_message textarea.val(),
messages.data('chat-room-id')
textarea.val('')
e.preventDefault()
return false
I am currently using Linux mint.
I'm using rails 5 to create a Facebook clone as a project and I periodically get an 'Errno::ENOENT in Devise::Sessions#new' error sometimes when I start the local server. I haven't yet experienced the problem on my production server. The problem goes away once I refresh the page.
The extracted source code is below. The line that starts stylesheet_link_tag is highlighted.
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
No such file or directory # rb_file_s_rename - path/facebook/tmp/cache/assets/sprockets/v3.0/Ej/EjoE1YdPTMb8n3_nucZiHWaR9FpoOSZttfl56_miOS0.cache.47161664401480.4109.232718, path/facebook/tmp/cache/assets/sprockets/v3.0/Ej/EjoE1YdPTMb8n3_nucZiHWaR9FpoOSZttfl56_miOS0.cache)
I have added the bootstrap-sass gem and have installed the bundle. I have gone to github and think I have followed the directions correctly to finish the install for ruby on rails. It doesn't appear to be making a difference however on my local site - no font/formatting changes have been made, even after the install.
I am using a PC, https://github.com/findingtheway/pin
Change your app/views/layouts/application.html.erb to this:
<head>
<title>Pin</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
Rails uses application by default you have default which is why bootstrap is not loading.