Ruby on Rails Tuesday, December 31, 2019



On Monday, December 30, 2019 at 4:52:46 PM UTC-5, Sampson Crowley wrote:
there are a massive number of possible reasons. you really should do some research on css display types, as I'm assuming `right` is supposed to be a element with "float: right" but "span" tags don't respond to floats unless they have been set as block-level elements

On Tuesday, December 24, 2019 at 7:07:32 PM UTC-7, fugee ohu wrote:
$('#message_holder').append('<div class="container"><span class="right">' + data.content + '</span><br></div>')

The string gets appended to the message_holder div like so:
<div class="container"><span class="right">9</span><br></div>

but the styling defined in .right doesn't get applied What to do?

 Actually I think my problem is in the content_tag in my view I could rewrite it as html but I may as well get this right the rails way Presently the problem is  data-conversation_with_id isn't being passed to the javascript

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0dabe4ca-180b-47e3-8769-a36177a1da35%40googlegroups.com.

Ruby on Rails



On Monday, December 30, 2019 at 4:52:46 PM UTC-5, Sampson Crowley wrote:
there are a massive number of possible reasons. you really should do some research on css display types, as I'm assuming `right` is supposed to be a element with "float: right" but "span" tags don't respond to floats unless they have been set as block-level elements

On Tuesday, December 24, 2019 at 7:07:32 PM UTC-7, fugee ohu wrote:
$('#message_holder').append('<div class="container"><span class="right">' + data.content + '</span><br></div>')

The string gets appended to the message_holder div like so:
<div class="container"><span class="right">9</span><br></div>

but the styling defined in .right doesn't get applied What to do?


view:
<h3>Conversation with <%= @conversation_with.name %></h3>
<%= content_tag :div, id: "message_holder", data: {conversation_with_id: @conversation_with.id} do %>

   <% @messages.each do |m| %>
        <% if m.sender==@conversation_with.id %>
            <div class="container-left"><%= m.content %></div>
        <% else %>
            <div class="container-right"><%= m.content %></div>
        <% end %>
    <% end %>

<% end %>

js:

 received(data) {
   
            if (data.sender==$('#message_holder').data-conversation_with_id)
               {
               $('#message_holder').append('<div class="container-left">' + data.content +  '</div>');
               }
            else
               {
               $('#message_holder').append('<div class="container-right">' + data.content + 'converation_with_id:'  +  '</div>');
               }

  }
});

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2ab75cf8-3ebd-4aa9-9450-83d37d5c27fa%40googlegroups.com.

Ruby on Rails



On Monday, December 30, 2019 at 4:52:46 PM UTC-5, Sampson Crowley wrote:
there are a massive number of possible reasons. you really should do some research on css display types, as I'm assuming `right` is supposed to be a element with "float: right" but "span" tags don't respond to floats unless they have been set as block-level elements

On Tuesday, December 24, 2019 at 7:07:32 PM UTC-7, fugee ohu wrote:
$('#message_holder').append('<div class="container"><span class="right">' + data.content + '</span><br></div>')

The string gets appended to the message_holder div like so:
<div class="container"><span class="right">9</span><br></div>

but the styling defined in .right doesn't get applied What to do?


  received(data) {
    
            if (data.sender==$('#message_holder').data('conversation_with_id'))
               {
               $('#message_holder').append('<div class="container-left">' + data.content + '</div>');
               }
            else
               {
               $('#message_holder').append('<div class="container-right">' + data.content + '</div>');
               }

  }
});

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/99c5ee02-3ef1-4ff5-a7ac-6461c33e4fd9%40googlegroups.com.

Ruby on Rails

Sprockets 4 added the manifest.js file https://github.com/rails/sprockets#upgrading-to-sprockets-4x. It's not a some rails version thing.

El mar., 31 dic. 2019 a las 14:52, fugee ohu (<fugee279@gmail.com>) escribió:
Beginning with what rails version is this path expected to exist?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/134e419e-b25a-4251-8aff-3cee2fb94f24%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcBqkvZSm7Hdpo%2BcE41G8Y7iy3eW7Qnp0wVdNEq%2BLYt5wA%40mail.gmail.com.

Ruby on Rails

I believe Rails 5

On Tue, Dec 31, 2019, 11:22 PM fugee ohu <fugee279@gmail.com> wrote:
Beginning with what rails version is this path expected to exist?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/134e419e-b25a-4251-8aff-3cee2fb94f24%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALUTCaiMu2C0kX_ddWKJ7HPRw%3DohorwFsRQWPFXZvM6bRNV0KA%40mail.gmail.com.

Ruby on Rails

Beginning with what rails version is this path expected to exist?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/134e419e-b25a-4251-8aff-3cee2fb94f24%40googlegroups.com.

Ruby on Rails Monday, December 30, 2019

there are a massive number of possible reasons. you really should do some research on css display types, as I'm assuming `right` is supposed to be a element with "float: right" but "span" tags don't respond to floats unless they have been set as block-level elements

On Tuesday, December 24, 2019 at 7:07:32 PM UTC-7, fugee ohu wrote:
$('#message_holder').append('<div class="container"><span class="right">' + data.content + '</span><br></div>')

The string gets appended to the message_holder div like so:
<div class="container"><span class="right">9</span><br></div>

but the styling defined in .right doesn't get applied What to do?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/735ab3ca-5818-4f77-95ea-bdec093bb03c%40googlegroups.com.

Ruby on Rails

> On Dec 29, 2019, at 11:44 PM, fugee ohu <fugee279@gmail.com> wrote:
>
> I searched my entire tree starting at / for the name of my mail server but didn't find it Everything's working it sends mail in production just fine but I'm trying to figure out how, since it seems I never put the url of my mail server anywhere?

Your production server may be set up with postfix or sendmail, and thus the default (SMTP to localhost) will Just Work™. When your application sends mail, it just sends a raw SMTP message to port 25 on the localhost, and the mail server running there accepts it and forwards it. That's the default, baked into Rails, in case you don't configure anything more specific.

This is almost never what you actually want, because unless your production Web server is also set up as an authoritative (DNS-verified) SMTP server, your mail delivery will be spotty at best to large (think Gmail) recipients. Those services take spam very seriously, and you have to climb over some tall fences (configured in DNS, mainly, through TEXT and MX records) in order to please them enough to accept your messages.

This is doubly-true if your application is designed to send mail that is "apparently-from" someone who is not at your server's domain. Services like SendGrid exist to take this pain away from you, making sending transactional e-mail as pain-free as possible, because they work to ensure that their servers don't end up on banned lists, or get off them quickly.

My recommendation if you want to send mail out to one user that appears to be from another user, such that they can just hit "reply" in their mail application and respond to it, send the message with the headers From: a-real-address@your-server.com, and Reply-to: user@example.com. That way the message is deliverable (since it came from you, and you authenticate that in your DNS settings), but the recipient can simply press Reply and not have to manually correct the To: address in that message.

Walter

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7D8D634C-0390-4E76-8D9A-3BA941D1EA83%40wdstudio.com.

Ruby on Rails

Try clearing your `tmp` directory.

On Sat, Dec 28, 2019 at 7:16 AM fugee ohu <fugee279@gmail.com> wrote:
I get very strange behavior from webpacker If something works then I change it, then it's broken so I undo my changes and save the file back the way it was, now things are still broken and stay broken until I restart my computer Have tried clearing browser cache, restarting webpack-dev-server, restarting Puma but only restarting my computer gets things working again

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2c9d678c-89f2-4383-bb38-db73dd6f5a8b%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALn2xuDU6vyKUPU221jawQ_bcGQyu-OSt769PS1qvgSnOc772A%40mail.gmail.com.

Ruby on Rails

https://nrel.wd5.myworkdayjobs.com/NREL/job/Golden-CO/Senior-Software-Developer_R5725


Putting this here in case anyone in this group wants to move to Colorado!

Looking for a very senior, full-stack Rails developer to join our awesome team at the National Renewable Energy Laboratory. It's a great place to work!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a9e5f068-e56b-4834-890b-610853873367%40googlegroups.com.

Ruby on Rails Sunday, December 29, 2019

I searched my entire tree starting at / for the name of my mail server but didn't find it Everything's working it sends mail in production just fine but I'm trying to figure out how, since it seems I never put the url of my mail server anywhere?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9c10c3ba-8f89-44e1-ad7f-7a1fa01dd31d%40googlegroups.com.

Ruby on Rails

On Sun, Dec 29, 2019 at 4:11 PM tom <tomabroad@gmail.com> wrote:

> i have an app with one api endpoint. that end point is more and more in use, and i was wondering how i can make that endpoint not boggle down the app?

Any of:

1. Benchmark, measure, address bottlenecks
2. Scale vertically
3. Scale horizontally

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yACu3Z1dc7AqRxT18UibrTrv%3DeHBQJhSzi7-%3DcAmVW7BQ%40mail.gmail.com.

Ruby on Rails

hi,

i have an app with one api endpoint. that end point is more and more in use, and i was wondering how i can make that endpoint not boggle down the app?

the result of the api is either kicking off a background job or a result from a calculation....

thank you


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMda9FmvQPRF9OwepMEXnqpKbGarDhs-yFDbv%2BNLMbVuQQ%40mail.gmail.com.

Ruby on Rails

ok, I had to move it from the class to each method.  


On Sunday, December 29, 2019 at 5:33:43 PM UTC-5, Joe Guerra wrote:
Hmm, not so sure how I got this error.

But my root_path breadcrumb is causing undefined before filter method.
Other paths work?

I'm just commenting it out for now.  

Any suggestions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/22126fa7-97ee-4c01-a3cc-f39a977538b3%40googlegroups.com.

Ruby on Rails Saturday, December 28, 2019

Thank you very much for your message. I discovered actually that someone had developed an i18n debug Gem that is very helpful to troubleshoot this.

I discovered actually that some keys where missing and that for some reason i18n was first relying on the fallback locale instead of looking in the translation file.
Filling in the missing locale entries allowed me to fix this.

Cedric
On 28. Dec 2019, 19:18 +0100, Ariel Juodziukynas <arieljuod@gmail.com>, wrote:

You can do something like this on an initializer so override the I18n lookup method to print each key it tries to find, maybe you can debug what's going on:

# config/initializers/debug_18n.rb

module I18n
module Backend
class Simple
# Monkey-patch-in localization debugging
# Enable with ENV['I18N_DEBUG']=1 on the command line in server startup, or ./config/environments/*.rb file.
#
def lookup(locale, key, scope = [], options = {})
init_translations unless initialized?
keys = I18n.normalize_keys(locale, key, scope, options[:separator])

puts "I18N keys: #{keys}"

keys.inject(translations) do |result, _key|
_key = _key.to_sym
return nil unless result.is_a?(Hash) && result.has_key?(_key)
result = result[_key]
result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)

puts "\t\t => " + result.to_s + "\n" if (result.class == String)

result
end
end
end
end
end

I don't rember where I took that code from to give the credit.

Now you can check that's actually trying to translate (from the code it's: some_resource_name.some_message)


El sáb., 28 dic. 2019 a las 14:30, Cédric Lefebvre (<derrioh@gmail.com>) escribió:
Sure, my application.rb contains the following:

    config.i18n.available_locales = [:en, :fr]
    config.i18n.default_locale = :en
    config.i18n.fallbacks = [I18n.default_locale]

The last line of your application.rb comes from heroes Gem, which I do not use.

On your website, are you sure the flash messages are localised? And if yes, which version of the devise and devise-i18n are you using?

Thanks

Cedric
On 28. Dec 2019, 14:18 +0100, fugee ohu <fugee279@gmail.com>, wrote:


On Thursday, December 26, 2019 at 6:17:23 PM UTC-5, Cédric Lefebvre wrote:
I have deployed devise & devise-i18n to internationalize devise. Everything works well - including all the i18n - except that flash messages generated by devise do not get translated

=> messages generated by devise and accessed via resource.errors.full_messages are localized
e.g. try to "sign_up" with no information filled in


=> flashes generated by devise are not localized
e.g. try to "sign_in" with no information filled in


Any idea why? Any idea on how to fix this?


Have you created settings for i18n in application.rb ?

Here's what application.rb looks like on one of my sites that uses locales:
    Rails.application.config.i18n.available_locales = ["ko", "zh-TW", "ja", "en-US"]
    Rails.application.config.i18n.default_locale = "en-US"
    ISO3166.configure do |config|
       config.locales = ['zh-TW', 'en-US', 'ko', 'ja']

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/526f03ab-5181-45e1-9a8d-622e1ec17fb6%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5b2e492a-a26e-4ee5-86d9-76bcff9fcdeb%40Spark.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDCQkyV0biL_ZHH-sGZPk%2Bedx2w2HHx3dwj2sSbT3KB8w%40mail.gmail.com.

Ruby on Rails


You can do something like this on an initializer so override the I18n lookup method to print each key it tries to find, maybe you can debug what's going on:

# config/initializers/debug_18n.rb

module I18n
module Backend
class Simple
# Monkey-patch-in localization debugging
# Enable with ENV['I18N_DEBUG']=1 on the command line in server startup, or ./config/environments/*.rb file.
#
def lookup(locale, key, scope = [], options = {})
init_translations unless initialized?
keys = I18n.normalize_keys(locale, key, scope, options[:separator])

puts "I18N keys: #{keys}"

keys.inject(translations) do |result, _key|
_key = _key.to_sym
return nil unless result.is_a?(Hash) && result.has_key?(_key)
result = result[_key]
result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)

puts "\t\t => " + result.to_s + "\n" if (result.class == String)

result
end
end
end
end
end

I don't rember where I took that code from to give the credit.

Now you can check that's actually trying to translate (from the code it's: some_resource_name.some_message)


El sáb., 28 dic. 2019 a las 14:30, Cédric Lefebvre (<derrioh@gmail.com>) escribió:
Sure, my application.rb contains the following:

    config.i18n.available_locales = [:en, :fr]
    config.i18n.default_locale = :en
    config.i18n.fallbacks = [I18n.default_locale]

The last line of your application.rb comes from heroes Gem, which I do not use.

On your website, are you sure the flash messages are localised? And if yes, which version of the devise and devise-i18n are you using?

Thanks

Cedric
On 28. Dec 2019, 14:18 +0100, fugee ohu <fugee279@gmail.com>, wrote:


On Thursday, December 26, 2019 at 6:17:23 PM UTC-5, Cédric Lefebvre wrote:
I have deployed devise & devise-i18n to internationalize devise. Everything works well - including all the i18n - except that flash messages generated by devise do not get translated

=> messages generated by devise and accessed via resource.errors.full_messages are localized
e.g. try to "sign_up" with no information filled in


=> flashes generated by devise are not localized
e.g. try to "sign_in" with no information filled in


Any idea why? Any idea on how to fix this?


Have you created settings for i18n in application.rb ?

Here's what application.rb looks like on one of my sites that uses locales:
    Rails.application.config.i18n.available_locales = ["ko", "zh-TW", "ja", "en-US"]
    Rails.application.config.i18n.default_locale = "en-US"
    ISO3166.configure do |config|
       config.locales = ['zh-TW', 'en-US', 'ko', 'ja']

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/526f03ab-5181-45e1-9a8d-622e1ec17fb6%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5b2e492a-a26e-4ee5-86d9-76bcff9fcdeb%40Spark.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDCQkyV0biL_ZHH-sGZPk%2Bedx2w2HHx3dwj2sSbT3KB8w%40mail.gmail.com.

Ruby on Rails

Sure, my application.rb contains the following:

    config.i18n.available_locales = [:en, :fr]
    config.i18n.default_locale = :en
    config.i18n.fallbacks = [I18n.default_locale]

The last line of your application.rb comes from heroes Gem, which I do not use.

On your website, are you sure the flash messages are localised? And if yes, which version of the devise and devise-i18n are you using?

Thanks

Cedric
On 28. Dec 2019, 14:18 +0100, fugee ohu <fugee279@gmail.com>, wrote:


On Thursday, December 26, 2019 at 6:17:23 PM UTC-5, Cédric Lefebvre wrote:
I have deployed devise & devise-i18n to internationalize devise. Everything works well - including all the i18n - except that flash messages generated by devise do not get translated

=> messages generated by devise and accessed via resource.errors.full_messages are localized
e.g. try to "sign_up" with no information filled in


=> flashes generated by devise are not localized
e.g. try to "sign_in" with no information filled in


Any idea why? Any idea on how to fix this?


Have you created settings for i18n in application.rb ?

Here's what application.rb looks like on one of my sites that uses locales:
    Rails.application.config.i18n.available_locales = ["ko", "zh-TW", "ja", "en-US"]
    Rails.application.config.i18n.default_locale = "en-US"
    ISO3166.configure do |config|
       config.locales = ['zh-TW', 'en-US', 'ko', 'ja']

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/526f03ab-5181-45e1-9a8d-622e1ec17fb6%40googlegroups.com.

Ruby on Rails



On Thursday, December 26, 2019 at 6:17:23 PM UTC-5, Cédric Lefebvre wrote:
I have deployed devise & devise-i18n to internationalize devise. Everything works well - including all the i18n - except that flash messages generated by devise do not get translated

=> messages generated by devise and accessed via resource.errors.full_messages are localized
e.g. try to "sign_up" with no information filled in


=> flashes generated by devise are not localized
e.g. try to "sign_in" with no information filled in


Any idea why? Any idea on how to fix this?


Have you created settings for i18n in application.rb ?

Here's what application.rb looks like on one of my sites that uses locales:
    Rails.application.config.i18n.available_locales = ["ko", "zh-TW", "ja", "en-US"]
    Rails.application.config.i18n.default_locale = "en-US"
    ISO3166.configure do |config|
       config.locales = ['zh-TW', 'en-US', 'ko', 'ja']

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/526f03ab-5181-45e1-9a8d-622e1ec17fb6%40googlegroups.com.

Ruby on Rails

I get very strange behavior from webpacker If something works then I change it, then it's broken so I undo my changes and save the file back the way it was, now things are still broken and stay broken until I restart my computer Have tried clearing browser cache, restarting webpack-dev-server, restarting Puma but only restarting my computer gets things working again

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2c9d678c-89f2-4383-bb38-db73dd6f5a8b%40googlegroups.com.

Ruby on Rails Thursday, December 26, 2019

I have deployed devise & devise-i18n to internationalize devise. Everything works well - including all the i18n - except that flash messages generated by devise do not get translated

=> messages generated by devise and accessed via resource.errors.full_messages are localized
e.g. try to "sign_up" with no information filled in


=> flashes generated by devise are not localized
e.g. try to "sign_in" with no information filled in


Any idea why? Any idea on how to fix this?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cecccb6f-1a79-4675-946b-78e6693f3f5b%40googlegroups.com.

Ruby on Rails

> On Dec 24, 2019, at 4:38 AM, fugee ohu <fugee279@gmail.com> wrote:
>
> I'm trying to create a chat view where if the sender of the message is the current user then the message is displayed on the right side and if the sender is the other user then the message is displayed on the left So far what I have doesn't right or left float the messages, they all appear in the same column
>
> chat.html.erb:
>
> <div>
> <h3>Conversation with <%= @conversation_with.name %>
>
> <div id="message_holder">
> <% @messages.each do |m| %>
> <% if m.sender=@conversation_with %>
> <div><span class="left-float"><%= m.content %></span><br></div>
> <% else %>
> <div><span class="right-float"><%= m.content %></span><br></div>
> <% end %>
> <% end %>
> </div>
>
> application.scss:
>
> .left-float
> {
> float: left;
> }
>
> .right-float
> {
> float: right;
> }
>

A span element is an "inline" element, like an individual character of text. It has no structure to it at all, unless you give it some by adding display: inline-block or display: block to it. If you change those spans to divs, you may see a different visual outcome, because divs are naturally display: block unless you direct otherwise.

Also, by itself, float left and float right won't give you any visual feedback unless the floated element is narrower than its parent element. A 100% wide element floated left doesn't look any different than a 100% wide element floated right. If I wanted to make a set of chat bubbles, I might start with this:

span.chat {
display: block;
width: 80%;
padding: .3em .9em;
border-radius: 1em;
background-color: #ccc;
float: left;
}

span.chat.originator {
float: right;
background-color: #cad5ff;
text-align: right;
}

And then amend the ERB to set the base class as well as add the override class when the message is by the person who started the chat. The result should be emitted like this:

<span class="chat originator">foo bar baz</span>
<span class="chat">boo blarg blech</span>

You could make this less specific, css-wise, by adding a "chat" class to the parent div, and then changing the selectors like this:

.chat span {
/* same as first rule above */
}

.chat > .originator {
/* same as the second rule above */
}

<div class="chat">
<span class="originator">foo bar baz</span>
<span>boo blarg blech</span>
</div>

Fool around with these ideas in a regular HTML file, previewed in a browser. Don't involve Rails in it at all. The problem is most likely in your HTML or CSS.

Walter

>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5cee16be-a1df-4748-b842-7bfab60c9e5c%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/58342DD0-E4D0-436F-A6F7-7A010205AD02%40wdstudio.com.

Ruby on Rails Wednesday, December 25, 2019

i ran `yarn add elasticsearch-lite` and then `PORT=9200 node_modules/.bin/elasticsearch`
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'worker_threads'

I'm doing this because my laptop can't handle elasticsearch

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/95d5d785-7e39-4db4-8d54-1831ea9265e3%40googlegroups.com.

Ruby on Rails Tuesday, December 24, 2019

$('#message_holder').append('<div class="container"><span class="right">' + data.content + '</span><br></div>')

The string gets appended to the message_holder div like so:
<div class="container"><span class="right">9</span><br></div>

but the styling defined in .right doesn't get applied What to do?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1274198e-b20c-4c84-8a0a-461bf4a68d27%40googlegroups.com.

Ruby on Rails

If you want to style  <%= m.content %>,  you need to wrap this in a HTML element then you can apply CSS.

Example:

<p class="clas-here" style="styles-here"><%= m.content %></p>

On Tue, Dec 24, 2019 at 5:17 PM fugee ohu <fugee279@gmail.com> wrote:
I have elements like <%= m.content %> where m stands for message as I iterate through @messages How do I style them since I haven't defined them as any type of element

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0e318fd1-a025-447d-a2b6-9515b48fbada%40googlegroups.com.


--
The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPmpWecWgq%2BsKdBSqhVG70R1hQgoOhq0mggOQ2hzHEUtjqFQCA%40mail.gmail.com.

Ruby on Rails

I'm trying to create a chat view where if the sender of the message is the current user then the message is displayed on the right side and if the sender is the other user then the message is displayed on the left So far what I have doesn't right or left float the messages, they all appear in the same column

chat.html.erb:

<div>
<h3>Conversation with <%= @conversation_with.name %>

<div id="message_holder">
    <% @messages.each do |m| %>
        <% if m.sender=@conversation_with %>
            <div><span class="left-float"><%= m.content %></span><br></div>
        <% else %>
            <div><span class="right-float"><%= m.content %></span><br></div>
        <% end %>
    <% end %>
</div>

application.scss:
   
.left-float
{
float: left;
}

.right-float
{
float: right;
}


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5cee16be-a1df-4748-b842-7bfab60c9e5c%40googlegroups.com.

Ruby on Rails

I have elements like <%= m.content %> where m stands for message as I iterate through @messages How do I style them since I haven't defined them as any type of element

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0e318fd1-a025-447d-a2b6-9515b48fbada%40googlegroups.com.

Ruby on Rails Monday, December 23, 2019

I removed the box param from conversations because I'm trying to show conversations in a chat type view meaning not have inbox, sent, trash available for the user So I get the error "

undefined method `paginate' for #<Mailboxer::Mailbox:0x00007f33e4031e88" from the line "@conversations = @conversations.paginate(page: params[:page], per_page: 10)" I have the will_paginate gem installed


Basically what I did trying to achieve chat style conversations view is I changed this line in the conversations_controller.rb

    @conversations = current_user.mailbox.inbox

to


    @conversations = current_user.mailbox

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02af6439-3d28-480f-a448-78408b51c92e%40googlegroups.com.

Ruby on Rails

If you have a file inside /packs called application.js that has a line "import Something from '../some_js'", webpacker will include the code from "some_js.js" inside the resulting bundle "application.js".

El lun., 23 dic. 2019 a las 12:10, fugee ohu (<fugee279@gmail.com>) escribió:


On Sunday, December 22, 2019 at 6:10:58 PM UTC-5, Ariel Juodziukynas wrote:
There's a section specifying where to put js files on the documentation https://github.com/rails/webpacker#paths. You can put the files anywhere, if you put them inside the packs folder webpacker will create bundles using those files, if you put them elsewhere wenpacker will bundle them inside the packs that require them.

El dom., 22 dic. 2019 a las 4:48, fugee ohu (<fuge...@gmail.com>) escribió:
Where do I put my custom javascript files now, under javascripts or under javascripts/packs or should i create a directory like 'custom' under javascripts and then in javascript/packs/application.js i would have to import "../custom" and that would import all the javascript files in the custom directory Can someone please clarify?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8295b70b-e09e-4fe3-96ba-cb5017125ace%40googlegroups.com.

wenpacker will bundle them inside the packs that require them
What does that mean?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b479f7ff-e3ce-4337-bd94-12042605bc84%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcC-E2JXvA4t51Mhe%3Dgu-wq%2Bqdo1eWxvwh7f02segOWtig%40mail.gmail.com.

Ruby on Rails



On Sunday, December 22, 2019 at 6:10:58 PM UTC-5, Ariel Juodziukynas wrote:
There's a section specifying where to put js files on the documentation https://github.com/rails/webpacker#paths. You can put the files anywhere, if you put them inside the packs folder webpacker will create bundles using those files, if you put them elsewhere wenpacker will bundle them inside the packs that require them.

El dom., 22 dic. 2019 a las 4:48, fugee ohu (<fuge...@gmail.com>) escribió:
Where do I put my custom javascript files now, under javascripts or under javascripts/packs or should i create a directory like 'custom' under javascripts and then in javascript/packs/application.js i would have to import "../custom" and that would import all the javascript files in the custom directory Can someone please clarify?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8295b70b-e09e-4fe3-96ba-cb5017125ace%40googlegroups.com.

wenpacker will bundle them inside the packs that require them
What does that mean?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b479f7ff-e3ce-4337-bd94-12042605bc84%40googlegroups.com.

Ruby on Rails Sunday, December 22, 2019



On Sunday, December 22, 2019 at 6:05:15 PM UTC-5, Ariel Juodziukynas wrote:
Webpacker provides an `asset_pack_path` method https://github.com/rails/webpacker#usage

I guess you'll need to use a .css.erb file in order for that to work.

# something.css.erb

.search_button {
  background: url('<%= asset_pack_path('images/search.png') %>');
}

Lately you are asking A LOT of questions about webpacker for images and CSS, you don't really HAVE to change from Sprockets to Webpacker to update to rails 6, in fact, if you start a new rails app, it uses webpacker only for javascript assets, it's still using sprockets for css and images by default. Of course you are free to use webpacker for everything but maybe you have to follow webpack guidelines and start messing with loaders, check the webpack guide on packing images and using it for background image for example https://webpack.js.org/guides/asset-management/#loading-images

El dom., 22 dic. 2019 a las 17:12, fugee ohu (<fuge...@gmail.com>) escribió:
Webpacker is serving images in views, I just don't know how to do it in css

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/549cd10d-f440-4ca0-a3a5-51748c623e92%40googlegroups.com.

I saw one post where someone suggests renaming javascripts to "webpacker" and then creating javascripts and images folders under "webpacker" Wanna get a good handle on being able to put assets wherever I want

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bd10518a-c532-42d0-ae2d-59818ea12874%40googlegroups.com.

Ruby on Rails



On Sunday, December 22, 2019 at 6:05:15 PM UTC-5, Ariel Juodziukynas wrote:
Webpacker provides an `asset_pack_path` method https://github.com/rails/webpacker#usage

I guess you'll need to use a .css.erb file in order for that to work.

# something.css.erb

.search_button {
  background: url('<%= asset_pack_path('images/search.png') %>');
}

Lately you are asking A LOT of questions about webpacker for images and CSS, you don't really HAVE to change from Sprockets to Webpacker to update to rails 6, in fact, if you start a new rails app, it uses webpacker only for javascript assets, it's still using sprockets for css and images by default. Of course you are free to use webpacker for everything but maybe you have to follow webpack guidelines and start messing with loaders, check the webpack guide on packing images and using it for background image for example https://webpack.js.org/guides/asset-management/#loading-images

El dom., 22 dic. 2019 a las 17:12, fugee ohu (<fuge...@gmail.com>) escribió:
Webpacker is serving images in views, I just don't know how to do it in css

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/549cd10d-f440-4ca0-a3a5-51748c623e92%40googlegroups.com.

Yea I know but I already see people saying why use both Also I wanna get used to this This is the first technology I'm getting in on the ground floor I feel, the time to learn/get used to using webpacker is now Moving all assets to webpacker is good practice for me Also using webpack-dev-server is a step forward, as soon as you save a file it recompiles and you get rewarded for doing something right when you save the file and the screen lights up green like a pinball machine rewards you for scoring

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8fe59f11-ae63-4533-80bd-8334cce04738%40googlegroups.com.

Ruby on Rails



On Sunday, December 22, 2019 at 6:12:50 PM UTC-5, Ariel Juodziukynas wrote:
The "nav" tag provides more meaning, I guess bootstrap just checks the class "navbar" so it doesn't care if you used a div or a nav, but in terms of semantics, a nav tag if better for a navigation bar as the name suggests.

El dom., 22 dic. 2019 a las 20:08, fugee ohu (<fuge...@gmail.com>) escribió:
Documentation says to use:
<nav class="navbar navbar-expand-lg navbar-light bg-light">
But in my views I've been using
<div class = "navbar navbar-default navbar-static-top">
The code is a little different, I have to try it out, but the question is the same Is applying the class to the div the same as not using the div for bootstrap purposes

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f79a4675-30bd-4527-872f-f65badb78d5b%40googlegroups.com.

Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/990f1ce9-6309-4a5b-ae09-c152b2b93be1%40googlegroups.com.

Ruby on Rails


El dom., 22 dic. 2019 a las 20:10, fugee ohu (<fugee279@gmail.com>) escribió:


On Sunday, December 22, 2019 at 6:08:08 PM UTC-5, Ariel Juodziukynas wrote:
You shouldn't have files inside pack except for the bundles/packs you'll link on your html, images go in javacsripts/images, not in javascripts/packs. Just read the guide https://github.com/rails/webpacker/blob/master/docs/assets.md#link-in-your-rails-views

El dom., 22 dic. 2019 a las 15:50, fugee ohu (<fuge...@gmail.com>) escribió:
If I put in application.js require.context('../images', true) everything works fine regardless of whether I place my images folder under javascripts or under javascripts/packs If I have my image folder under packs and change it to require.context('images', true) it breaks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/acaa913d-e589-4c10-af28-7488d2777f77%40googlegroups.com.

Actually have all my js files inside packs for now Where should I put those Note: original question was about images

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4d2ca96e-903e-4182-baea-d6f0f0b815de%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDaGUnTUPHK%2BMQW7VvWcV1rxM9D3iewrxBRV%3DLJDtwrwg%40mail.gmail.com.