naftilos76

Activity Graph

Page 1 of 9 | Next »

2019-10-03

[16:06:42] naftilos76: has joined #RubyOnRails
[17:25:53] naftilos76: Hi, i want to be able to selectively load part of a css file depending on the user accessing the website. Loading the whole file would not make sence sincethere could be 10nths of users' css styling in it. Would it make sence to make the .css file a .css.erb file and use ruby conditions to fetch parts of the css file that belong to the user accessing?
[20:09:36] naftilos76: Ping timeout: 245 seconds

2019-09-21

[06:43:32] naftilos76: has joined #RubyOnRails
[06:44:13] naftilos76: Hi, is there a way to get the server running mode in rails?
[12:25:43] naftilos76: jhass: already found it - thanks!
[12:26:06] naftilos76: i do not see people in here.. is rails dying?
[13:09:55] naftilos76: Quit: Leaving

2019-09-18

[10:10:48] naftilos76: has joined #RubyOnRails
[10:12:39] naftilos76: Hi everyone, how can an image that is uploaded in app/assets be seen on a website that is operating in production mode? A restart alone would do it but that takes time maybe a few secs. Is there another way?
[14:34:56] naftilos76: Hi, on development mode i use this path to load an image as a background image of a div => url('/assets/dir1/dir2/image.png') . What should the url be in production mode? Should the url include the hash?
[16:37:41] naftilos76: NL3limin4t0r: thnks
[17:11:33] naftilos76: NL3limin4t0r: one thing i do not understand is whether having a file called images.css.erb with the following code inside: #one_level_up_button { background-image: url('<%= asset_path '/assets/system/level_up_24.png' %>'); } will be compiled along with all of the other css files and will end up with the image name having the hash embedded. Is that it?
[17:12:50] naftilos76: Can anybody else comment on this?
[17:30:25] naftilos76: NL3limin4t0r: i have seen all that - when i compile the assets i then go and open application.css and search for level_up_24 . I do find it in the application.css but there is no fingerprint embedded in the image name. I am not sure why...
[17:30:49] naftilos76: When i say application.css i mean the one with the hash embedded
[17:31:32] naftilos76: the image file does exist in app/assets/images/system
[17:31:55] naftilos76: Any ideas why?
[17:33:31] naftilos76: In a few words, #one_level_up_button { background-image: url('<%= asset_path '/assets/system/level_up_24.png' %>'); } gets converted to #one_level_up_button{background-image:url("/assets/system/level_up_24.png")}
[17:33:59] naftilos76: As you can see no fingerprint
[17:34:20] naftilos76: Should the fingerprint be there ?
[17:36:39] naftilos76: NL3limin4t0r: got!
[17:37:06] naftilos76: the url i had inside asset_path should be system/level_up_24.png
[17:37:42] naftilos76: this is the one that worked <%= asset_path 'system/level_up_24.png' %>
[17:38:13] naftilos76: i know that - production is what i am talking about
[18:02:13] naftilos76: NL3limin4t0r: as i said it worked - production.rb seems to be ok - config.assets.digest is already true
[21:58:16] naftilos76: Quit: Leaving

2019-09-17

[05:37:46] naftilos76: has joined #RubyOnRails
[07:59:04] naftilos76: Hi i was reading rails assets pipeline and i am still wondering what i should do when it comes to images dynamically added. For example, an image is added to a div as its background. Doing that resulted in the image not loading. As assets pipeline indicates, server has to be restarted in order for that image to be able to be loaded.
[08:00:35] naftilos76: What is the solution to load images added in app/assest/images after deployment?
[08:20:23] naftilos76: What should i do in production mode in order to load an image added to app/assets/images after deployment ?
[08:20:51] naftilos76: restarting the server is one but that is not an option
[08:27:52] naftilos76: How can images be loaded in an e-shop app when rails server is in production mode? Restart server?
[08:32:38] naftilos76: What happens if the contents of app/assets/images change after deployment in production mode? Re-compile?
[08:32:46] naftilos76: Can anybody help?
[08:33:33] naftilos76: For god's name, where is everyone?
[12:58:30] naftilos76: After precompiling assets and working in production mode for a while i decided to add a db migration (add a col to a table). When i tried to do this: rails g migration AddWebsiteIdToArticles website_id:integer i got an error
[12:58:57] naftilos76: config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
[12:58:58] naftilos76: * production - set it to true
[12:58:58] naftilos76: * test - set it to false (unless you use a tool that preloads your test environment)
[12:58:58] naftilos76: * development - set it to false
[12:59:56] naftilos76: I am not sure what is wrong
[13:00:34] naftilos76: I was able to do migrations before working in production mode but nw i cannot
[14:13:07] naftilos76: Hi everyone, supposing thati have a rails app in production mode and i add one image in app/assets/images. What do i have to do to dynamically reflect the changes to the website? 1) run $rake assets:precompile RAILS_ENV=production ??? 2) restart server?
[14:14:28] naftilos76: Restarting the server will do the trick without pre-compiling as i saw but that is not something one would be happy to do in a high traffic website!
[19:25:25] naftilos76: Ping timeout: 268 seconds

2019-09-16

[09:26:03] naftilos76: has joined #RubyOnRails
[09:28:16] naftilos76: Hi, will ENV["test"] in irb reflect the environment var 'test' set in a bash terminal by doing test=some_value ?
[14:17:06] naftilos76: Quit: Leaving
[15:49:24] naftilos76: has joined #RubyOnRails
[15:50:37] naftilos76: Hi, everyne. Do you know of any tutorials of deploying a rails app in production mode not necessarily with capistrano or puma?
[15:51:03] naftilos76: I have a rails 4.2.4 app
[18:45:45] naftilos76: Hi, what happens when images are compiled into a production server and their files are converted to name-of-file_checksum.png ??? The js code for example will still be searching for the file without the checksum part, right? If this is right then it will no find the image!
[18:47:29] naftilos76: It seems that preparing for production is really messy...
[18:53:47] naftilos76: After compiling without uglifier (which gives me a few errors) i can see in the console that application.js was not loaded. Any ideas why? Something i should config?
[18:54:41] naftilos76: => http://localhost:3000/assets/application-3bef2d6c99352cbedd11de8105578159c5b9c38006055ddf2f4d1b852337d90b.js could not be loaded
[18:55:00] naftilos76: Can anyone help?
[18:59:27] naftilos76: OK! fixed it. Should have set config.assets.compile = true in production.rb
[19:11:32] naftilos76: Trying to compile with uglifier enabled i get an error : ExecJS::ProgramError: Unexpected token punc «}», expected punc «:» (line: 21524, col: 25, pos: 1147269) This is most probably due to ES6 incompatibility but i cannot trace the js file that the error is refering to. Any ideas?
[19:12:01] naftilos76: It does say line no but not the file name!
[19:18:13] naftilos76: what on earth....
[20:50:50] naftilos76: Ping timeout: 240 seconds

2019-09-11

[05:40:12] naftilos76: has joined #RubyOnRails
[10:51:22] naftilos76: Quit: Leaving

2019-09-08

[20:28:50] naftilos76: has joined #RubyOnRails
[20:31:16] naftilos76: Hi, i was trying to get a 2D array of values from a table products. I need the resulting 2D array to be something like [["usb memory", "5 euro"], ["printer", 20 euro"], ...] . I am not sure how to do it. I am in rails 4.2.4. Can anybody help?
[20:32:30] naftilos76: I could do this: Product.where(conditions).collect {} but not sure how the result i want can be accmplished
[20:43:50] naftilos76: database query on products table based on an array of columns: ["id", "price"] ?
[20:44:20] naftilos76: It should be a fairly simple task but i cannot find anything in rails guides...
[21:00:20] naftilos76: cnsvc: i was trying to make it work based on ["name", "price"]
[21:00:55] naftilos76: so if that array is a var then i would provide that var to a rails method
[21:02:23] naftilos76: one way is to do Product.select(array) but that returns something else
[21:12:51] naftilos76: Product.select(array).collect {|r| array.collect {|e| r[e] }}} works
[21:13:36] naftilos76: cnsvc: i told you it has got to be based on a single array
[21:14:10] naftilos76: This returns a 2D array as required
[21:15:06] naftilos76: remove one } from the end :)
[21:30:20] naftilos76: jhass: i have done thanks - moving on
[22:26:58] naftilos76: Quit: Leaving

2019-09-04

[10:56:54] naftilos76: has joined #RubyOnRails
[10:57:32] naftilos76: Hi, is there an easier way to get a class constant inside a controller action other than this: self.class.name.split("sController")[0].constantize ??
[10:58:53] naftilos76: For example inside a ProductsController action i want to get the constant Product in order to do Product.find(...)
[12:01:01] naftilos76: Quit: Leaving

2019-08-25

[18:45:46] naftilos76: has joined #RubyOnRails
[18:46:39] naftilos76: Hi everyone, what is the most common way to deploy a rails app? I am on 4.2.4 and using ruby 2.2 via RVM.
[18:47:09] naftilos76: I saw a few like Capistrano & Mina. Which is better?
[18:48:59] naftilos76: havenwood: I have never used any of them so i will have a look. Regarding ruby, yea i know it is not supported... I will go to another version soon :)
[19:30:48] naftilos76: Ping timeout: 272 seconds

2019-08-09

[12:06:15] naftilos76: has joined #RubyOnRails
[12:09:58] naftilos76: I am having a weird behaviour in my 4.2.4 rails app. An object instance @jscript.code contains this string: "1234\r\n456" but when i try to do inside a view <div style="...."><%= @jscript.code %></div> the string does not show up. If the unix new line is not in the string then the string shows up as expected. What am i missing here?
[12:26:32] naftilos76: Problem solved - do not bother
[13:08:48] naftilos76: Ping timeout: 245 seconds
[18:44:47] naftilos76: has joined #RubyOnRails
[19:55:56] naftilos76: Quit: Leaving

2019-08-02

[07:59:26] naftilos76: has joined #RubyOnRails
[08:02:47] naftilos76: Hi i am working on a rails 4.2.4 app and trying to download any file that i want just by placing it in the ../public/downloads folder. I am in dev mode. It works in a rails app that i have already setup in my vps but the one i am working right now doesn't. When i try to access the path i get : Forbidden. You don't have permission to access /download/gps.zip on this server. Any ideas what may be wrong?
[08:03:28] naftilos76: the folder is ../public/download not ../public/downloads
[08:06:19] naftilos76: Even if i place the file in public folder i still get the error
[08:09:01] naftilos76: I basically want to be able to download any file from a rails folder tree without using method send_file
[08:09:08] naftilos76: Can anybody help?
[08:27:41] naftilos76: Problem resolved - i had to change 'others' group permissions
[08:54:20] naftilos76: Quit: Leaving

2019-07-30

[08:47:58] naftilos76: has joined #RubyOnRails
[08:50:38] naftilos76: Hi i am running a 4.2.4 rails app in my laptop with webrick and it runs fine but on my vps i get "Specified 'sqlite3' for database adapter, but the gem is not loaded." The adapter is clearly defined in database.yml to "mysql2" . Any ideas why this is happening?
[08:54:25] naftilos76: Remote host closed the connection

2018-07-24

[09:40:51] naftilos76: has joined #ruby
[20:22:25] naftilos76: Quit: Leaving

2018-07-14

[07:06:23] naftilos76: has joined #ruby
[07:34:09] naftilos76: Quit: Leaving

2018-07-13

[05:53:09] naftilos76: has joined #ruby
[05:56:37] naftilos76: Hi, i want to redirect warning and error messages from a shell command in my ruby script into a variable. For example, i am compiling some cpp files with 'g++ main.cpp -c' and i want the warning messages to be saved in a variable.
[05:58:55] naftilos76: havenwood: thanks a lot
[06:49:33] naftilos76: Ping timeout: 264 seconds
[06:50:28] naftilos76: has joined #ruby
[07:48:35] naftilos76: Quit: Leaving

2018-07-07

[04:37:08] naftilos76: has joined #ruby
[08:05:43] naftilos76: Quit: Leaving

2018-07-06

[21:18:58] naftilos76: has joined #ruby
[21:29:14] naftilos76: Quit: Leaving

2018-07-05

[07:29:38] naftilos76: has joined #ruby
[15:46:35] naftilos76: Ping timeout: 240 seconds
[17:56:17] naftilos76: has joined #ruby
[20:51:57] naftilos76: Quit: Leaving

2018-07-04

[10:14:36] naftilos76: has joined #ruby
[11:41:10] naftilos76: Quit: Leaving

2018-07-03

[16:03:23] naftilos76: has joined #ruby
[17:24:25] naftilos76: Ping timeout: 260 seconds

2018-07-02

[09:55:08] naftilos76: has joined #ruby
[16:34:47] naftilos76: Quit: Leaving

2018-07-01

[09:05:39] naftilos76: has joined #ruby
[09:08:18] naftilos76: Hi i have just tried executing a ruby script that starts with "#!/usr/bin ruby" and the next line is "puts "this is a test" and i get: bash: ./test: /usr/bin: bad interpreter: Permission denied . The file's permissions are -rwxrwxr-x .
[09:08:59] naftilos76: When i do `which ruby` in a terminal i get /usr/bin/ruby
[09:09:22] naftilos76: I am using rvm but at this point i have done 'rvm use system'
[09:09:43] naftilos76: if i do: ruby test then it works!
[09:10:10] naftilos76: Isn't that weird? I am on Linux mint 18.3
[09:10:45] naftilos76: Has anybody got a clue what this is all about?
[09:12:32] naftilos76: Zarthus: it works thanks with /usr/bin/env
[13:45:40] naftilos76: Ping timeout: 245 seconds
[14:41:57] naftilos76: has joined #ruby
[15:48:06] naftilos76: Quit: Leaving
[17:04:58] naftilos76: has joined #ruby
[17:52:24] naftilos76: Quit: Leaving

2018-05-01

[19:18:48] naftilos76: has joined #ruby
[20:02:04] naftilos76: Quit: Αποχώρησε

2018-03-18

[17:04:13] naftilos76: has joined #ruby
[17:47:52] naftilos76: Quit: Αποχώρησε

2018-03-04

[16:59:40] naftilos76: has joined #ruby
[19:37:30] naftilos76: Quit: Αποχώρησε

2018-03-03

[16:24:44] naftilos76: has joined #ruby
[17:26:52] naftilos76: Quit: Αποχώρησε

2018-02-05

[19:35:19] naftilos76: has joined #ruby
[20:13:02] naftilos76: Quit: Αποχώρησε

2018-01-08

[17:56:58] naftilos76: has joined #ruby
[19:22:34] naftilos76: Quit: Αποχώρησε

2017-12-01

[15:34:06] naftilos76: has joined #ruby
[18:08:58] naftilos76: Quit: Αποχώρησε

2017-10-23

[17:43:43] naftilos76: has joined #ruby
[17:56:38] naftilos76: Ping timeout: 255 seconds
[17:58:30] naftilos76: has joined #ruby
[18:57:27] naftilos76: Quit: Αποχώρησε
[19:19:40] naftilos76: has joined #ruby
[20:01:05] naftilos76: Ping timeout: 240 seconds
[20:09:35] naftilos76: has joined #ruby
[20:56:11] naftilos76: Ping timeout: 255 seconds

2017-10-10

[14:46:13] naftilos76: has joined #ruby

2017-10-09

[17:29:40] naftilos76: has joined #ruby
[18:19:18] naftilos76: has joined #RubyOnRails
[18:20:03] naftilos76: is there a gem to unpack / beautify an unglified javascript file ?
[20:29:37] naftilos76: Ping timeout: 255 seconds

2017-10-08

[07:56:49] naftilos76: has joined #ruby
[07:57:01] naftilos76: has joined #RubyOnRails
[07:58:29] naftilos76: Hi, is there a gem that can be used to load a controller file from another rails app and give me a list of defs, before/after filters, defs after a private or protected section etc?
[10:40:25] naftilos76: Quit: Αποχώρησε

2017-10-06

[13:13:52] naftilos76: has joined #ruby
[14:13:08] naftilos76: Ping timeout: 240 seconds

2017-10-05

[16:55:54] naftilos76: has joined #ruby
[19:28:31] naftilos76: Ping timeout: 248 seconds

2017-10-04

[16:13:16] naftilos76: has joined #ruby
[16:15:45] naftilos76: hi i am trying to extract a substring from a big string with "some_string".scan(//) . Assuming that there are two words in the big string "one" and "two" and i want to extract the substring between these two words what would be your approach?
[16:19:10] naftilos76: Papierkorb, correct question! one occurence only
[16:21:35] naftilos76: Papierkorb, thanks, that would be mine but somehow it does not work
[16:21:47] naftilos76: let me try a few things
[16:24:29] naftilos76: Papierkorb, i have an instance that contains a big string and i do this: @file_data[/^(.*)$/, 1] and i get an empty string. Is that what it should do?
[16:25:03] naftilos76: "" is what i get
[16:25:24] naftilos76: i try this while using byebug
[20:19:42] naftilos76: Ping timeout: 260 seconds

2017-09-30

[04:46:17] naftilos76: has joined #ruby
[04:46:41] naftilos76: has joined #RubyOnRails
[04:48:05] naftilos76: hi, is there a beautifier gem that can auto format most files in rails? I tried HTMLbeautifier but did not perform as expected on a js.erb view file. Anyone?
[19:33:56] naftilos76: Quit: Αποχώρησε

2017-09-18

[19:10:57] naftilos76: has joined #ruby
[20:40:30] naftilos76: Quit: Αποχώρησε

2017-09-03

[18:35:58] naftilos76: has joined #ruby
[20:34:20] naftilos76: Quit: Αποχώρησε

2017-08-08

[21:05:52] naftilos76: has joined #ruby
[21:18:07] naftilos76: Quit: Αποχώρησε

2017-07-30

[11:59:41] naftilos76: has joined #ruby
[11:59:53] naftilos76: has joined #RubyOnRails
[12:06:51] naftilos76: Hi, i am facing a problem with my project. I have backgrounds (controller) which has_many backgrounds and belongs_to background . This worked fine until i had the need for a background to belong to one or more backgrounds. Can a join table do the job? I mean, there should be 2 columns of this_id and that_id and as you can understand both will be background_id which is impossible. Is there another way to accomplish this?
[14:58:34] naftilos76: Hi, i am facing a problem with my project. I have backgrounds (controller) which has_many backgrounds and belongs_to background . This worked fine until i had the need for a background to belong to one or more backgrounds. Can a join table do the job? I mean, there should be 2 columns of this_id and that_id and as you can understand both will be background_id which is impossible. Is there another way to accomplish this?
[15:02:13] naftilos76: oded, the tricky part is that associations will be between the same mdel
[15:59:18] naftilos76: Quit: Αποχώρησε

2017-07-23

[10:22:17] naftilos76: has joined #ruby
[10:44:44] naftilos76: Does anybody know a tool that can validate CSS property values?
[10:44:55] naftilos76: In ruby i mean...
[12:07:29] naftilos76: Quit: Αποχώρησε
[19:06:07] naftilos76: has joined #ruby
[19:56:49] naftilos76: Quit: Αποχώρησε

2017-06-18

[12:26:14] naftilos76: has joined #ruby
[12:27:12] naftilos76: Read error: Connection reset by peer

2017-06-10

[09:27:16] naftilos76: has joined #ruby
[10:02:56] naftilos76: Quit: Αποχώρησε

2017-05-09

[08:38:29] naftilos76: has joined #ruby
[11:05:27] naftilos76: Ping timeout: 240 seconds

2017-04-27

[09:28:47] naftilos76: has joined #ruby
[09:29:07] naftilos76: has joined #RubyOnRails
[09:29:34] naftilos76: Read error: Connection reset by peer
[09:33:27] naftilos76: has joined #ruby
[09:33:44] naftilos76: has joined #RubyOnRails
[09:39:52] naftilos76: Hi, everyone. I am debugging a rails 4.2 app and playing with FF debugging tools. When something goes wrong in a controller i do "render "common/error", status: 422" . Now, error.js.erb is one tiny js view that simply contains a js alert("An error occured, pls see the log for more info..."); That works fine until i use the debugging tools to manually change the query string or the request body params. When i re-submit that request that i change
[09:39:53] naftilos76: its' params then the erro.js.erb view is still rendered but i get no js alert message. Does anybody have any idea why this happens?
[12:04:57] naftilos76: Quit: Αποχώρησε

2017-04-25

[08:38:00] naftilos76: has joined #ruby
[08:39:53] naftilos76: has joined #RubyOnRails

2017-04-09

[15:15:48] naftilos76: has joined #RubyOnRails
[15:15:48] naftilos76: has joined #ruby
[17:40:51] naftilos76: Quit: Αποχώρησε

2017-04-06

[09:12:49] naftilos76: has joined #RubyOnRails
[09:12:49] naftilos76: has joined #ruby
[09:34:49] naftilos76: Quit: Αποχώρησε

2017-04-05

[09:36:32] naftilos76: has joined #RubyOnRails
[09:36:32] naftilos76: has joined #ruby
[16:40:44] naftilos76: Hi everyone, i have a class method named foo that returns a hash like this: {"id"=>1, "name"=>"some_string", "title"=>"some_title"} . This means that i can do foo["id"] and get the id. What if i want to do foo.id and get the id?
[18:24:30] naftilos76: Assuming that i have a hash {"id"=>1, "title"=>"Happy new year"} and i do => local_var = {"id"=>1, "title"=>"Happy new year"} . Then i can do local_var["id"] . How can i convert the hash keys into hash methods so that i can do local_var.id ?
[20:38:57] naftilos76: Quit: Αποχώρησε

2017-04-04

[09:01:51] naftilos76: and we all know that session size has limitations
[09:03:40] naftilos76: sevenseacat, why does everybody hate global vars?
[09:06:22] naftilos76: matthewd, i am just trying to do it the right way. I am not a know-everything guy. I am not even close.
[09:11:11] naftilos76: matthewd, thanks for your time.
[11:04:23] naftilos76: Quit: Αποχώρησε