worknick

Activity Graph

Page 1 of 4 | Next »

2018-05-29

[05:36:18] worknick: has joined #RubyOnRails
[05:36:46] worknick: sending email with deliver_now works but when deliver_later sends it to delayed_job queue, it executes the job but actual email is not sent.
[05:36:51] worknick: how to troubleshoot this?
[06:33:41] worknick: syndikate, all those are fine, because if i do deliver_now or just deliver then it works
[06:47:27] worknick: Ping timeout: 240 seconds

2017-10-25

[04:51:45] worknick: has joined #RubyOnRails
[05:01:48] worknick: my locales are mounted at get ':/locale' => "Controller#action", as: 'myroot'. this workes everywhere except on production. on production nginx just gives a blank page. production on my local machine works. production on real production just gives blank page for `myip/ru` e.g.
[05:02:00] worknick: i am using nginx puma rails 5
[05:08:06] worknick: Radar, as given here http://guides.rubyonrails.org/i18n.html
[05:08:44] worknick: ok, I have exact this line get '/:locale' => 'pages#index', as: 'locale_root'
[05:27:45] worknick: Radar, any idea?
[05:49:27] worknick: Radar, template not found for this request
[05:49:43] worknick: and i get this error only on production vps. dont get it on local machine production env
[05:49:52] worknick: template missing for /:locale
[05:55:08] worknick: i added respond_to :html in pages index action
[06:22:45] worknick: Quit: Leaving

2017-10-16

[11:27:30] worknick: has joined #RubyOnRails
[11:27:52] worknick: how scalable / recommended is this type of if condition on application layout? https://stackoverflow.com/questions/22646048/rails-render-a-different-header-just-on-homepage
[11:28:36] worknick: won't that create extra processing overhead for all other pages?
[12:21:50] worknick: has left #RubyOnRails: ("Leaving")

2017-10-05

[05:25:22] worknick: has joined #RubyOnRails
[05:25:50] worknick: i have a public/test.html page. how can i access rails assets such as css files and images insiide this test.html page?
[05:26:04] worknick: no controller involved. just plain html page.
[05:26:11] worknick: no routes too.
[05:48:29] worknick: Quit: Leaving

2017-09-01

[11:50:04] worknick: has joined #RubyOnRails
[11:50:46] worknick: where to put webpack configuration in rails app? i already have config/wepback.yml and config/webpack/dev|prod|test.js it should be in one of these files or webpack.config.js at root?
[12:21:12] worknick: Quit: Leaving
[16:25:16] worknick: has joined #RubyOnRails
[16:26:33] worknick: I am facing this issue https://github.com/reactjs/react-rails/issues/711 . My code: https://gist.github.com/anonymous/2bb9722321f11bfe513beb45198bb271
[16:26:49] worknick: I am using rails 5.1.2 ruby 2.4.0 webpack 3.5.5
[16:27:25] worknick: I get the error for return <TimerExample line
[16:27:34] worknick: how to fix it?
[16:29:47] worknick: yes. you can see it in the code i shared react.js file which is in my loadrs folder of webpack
[16:32:55] worknick: tried with stage-2 did not worked. hence tried latest version.
[16:34:10] worknick: unanwered https://github.com/reactjs/react-rails/issues/531
[16:37:53] worknick: Quit: Leaving

2017-08-30

[11:04:18] worknick: has joined #RubyOnRails
[11:04:53] worknick: i have a javascript code inside my .html.haml page. how can i provide I18n value to one of the javascript variable here?
[11:05:08] worknick: options: { title: t('test') }
[11:05:09] worknick: how to do that?
[11:09:48] worknick: using haml.
[11:10:02] worknick: title: "#{var}" worked
[11:10:20] worknick: sylario, why not good ideao?

2017-08-15

[04:48:46] worknick: has joined #ruby
[04:48:59] worknick: how to connect to Push API in WAMP websocket?
[05:54:09] worknick: Ping timeout: 248 seconds

2017-08-14

[08:28:52] worknick: has joined #ruby
[08:29:12] worknick: how can i achive ruby mycode.rb | less functionality from inside mycodoe.rb ??
[08:30:16] worknick: something from ruby itself?
[08:32:43] worknick: want to do this from my ruby code without using any external tool like less
[09:28:53] worknick: Quit: Leaving

2017-08-03

[04:42:32] worknick: has joined #ruby
[04:43:19] worknick: i have X = {"A":1, "B":2} and Y = {"C":11, "D": 22} how can i do 1*2 + 2*22 ??
[04:44:10] worknick: i mean, 1*11 + 2 * 22
[05:34:17] worknick: havenwood, Thanks. emers2n havenwood answered.
[06:31:43] worknick: Ping timeout: 240 seconds

2016-03-11

[10:23:22] worknick: has joined #RubyOnRails
[10:39:37] worknick: how can i set a form attribute value depending upon a radio button selection?
[10:42:16] worknick: i tried to set name attribute of radio button using <%= pacm.radio_button :user_id, cp.id, :html => {:name=>"commentrad"}%> and do not set it correctly
[10:50:46] worknick: universa1: that does not say how to set custome name. that thing automatically creates itn own name using two attributes
[10:50:55] worknick: model[column] which i dont want.
[10:51:18] worknick: universa1: actually i have to use one radio button set for two different colums. hence its giving issues.
[10:54:59] worknick: universa1: this is my current new comment form. this is half baked because i am in process of setting it correct https://gist.github.com/wrknck/07a7fd67ad8ffa0841cd i have user_id and pet_id columns in my comment model. i want user to either select user_id radio button or (one of the) pet_id radio button
[10:58:56] worknick: universa1: can i set value of another attruebit inside radio_button so if this particuler radio button is set that attribute wil also set, otherwise not?
[11:00:49] worknick: universa1: which one?
[11:10:40] worknick: Quit: WeeChat 1.4

2016-03-07

[09:09:41] worknick: has joined #RubyOnRails
[09:10:03] worknick: how can i call custom method from my cotrollers destroy action by passing it params.
[09:11:19] worknick: yeah but what about params?
[09:11:31] worknick: just method(:id => id)
[09:11:49] worknick: i want to pass params also to that custom method.
[09:12:01] worknick: universa1: in other actions they are passed by vies to action
[09:12:25] worknick: i dont want to call destroy.
[09:13:22] worknick: see i have two methods in my controller def clearrate.... end and def destroy ... end. "inside" def destroy i have to call clearrate!
[09:13:25] worknick: along with params
[09:14:24] worknick: its not a problem.
[09:14:33] worknick: its so simple.
[09:14:42] worknick: just another method from destroy method.
[12:45:51] worknick: daveomcd: cancan?
[12:46:22] worknick: oh without additional gem
[12:47:01] worknick: daveomcd: why not just extra column to store user.role and checking if user.role?
[16:55:42] worknick: Quit: WeeChat 1.4

2016-03-05

[14:59:55] worknick: has joined #RubyOnRails
[15:01:00] worknick: i want to do this validates_presence_of :actimg, :unless => lambda {self.wall_id.present?} but it fails because, in my controller if wall_id is empty i am setting it manually to some other param. how can now trigger this validaiton before i set wall_id manually in my controller?
[15:04:39] worknick: or, can i validate one param depending upon page location?
[15:36:30] worknick: can i validate one param depending upon page location?
[15:41:15] worknick: _bogus_: ok
[16:00:09] worknick: _bogus_: i got custom function, but current_page keyword gives error undefined method. how can i check if this request is coming from root page or not?
[16:10:13] worknick: _bogus_: ok
[16:17:45] worknick: Quit: WeeChat 1.4

2016-03-01

[06:36:06] worknick: has joined #RubyOnRails
[06:36:51] worknick: is if params.has_key?(:wall_id) this a correct way to check if :wall_id is present? i have two different forms. one form do not have :wall_id at all . second one has. is this the correct way to check if the data is coming from the second form and :wall_id present?
[07:27:09] worknick: is if params.has_key?(:wall_id) this a correct way to check if :wall_id is present? i have two different forms. one form do not have :wall_id at all . second one has. is this the correct way to check if the data is coming from the second form and :wall_id present?
[07:27:30] worknick: which is right way?
[07:28:43] worknick: one form do not have <%=p.hidden_filed :wall_id at all. the second one has. when second one has it :wall_id will always have the valueto it.
[07:33:40] worknick: if its :wall_id is empty i have to perform one action. and i used your suggestion .present? and its working correctly now.
[07:33:47] worknick: "" should be false.
[08:20:06] worknick: how can detect if a partial is being executed on non root (/) page?
[11:21:13] worknick: Quit: WeeChat 1.4

2016-02-29

[10:52:20] worknick: has joined #RubyOnRails
[10:52:35] worknick: is it okey to do, Model.where inside my view?
[11:03:23] worknick: arup_r: :-D
[11:03:53] worknick: xhoy_: you meant "live"?
[11:19:08] worknick: is there any delete_all similar to delete the "very latest" record i just created in db?
[11:19:15] worknick: belonging to specific user
[12:59:46] worknick: peterppp: i dont think so.
[12:59:55] worknick: just a custome method in that particular model is fine.
[17:30:34] worknick: Quit: WeeChat 1.4

2016-02-28

[12:55:52] worknick: has joined #RubyOnRails
[12:56:43] worknick: i have user has_many commentns and comment belongs to user. what shall i be looking for when my comment.user printns <hexcodeforuser> but comment.user.id says undefined method if for nil nill class.
[12:56:58] worknick: thats my models https://gist.github.com/wrknck/d704dee93ecf1a161905
[13:03:40] worknick: sevenseacat: https://gist.github.com/wrknck/d704dee93ecf1a161905 is my models. adding error to that. just a sec
[13:05:57] worknick: sevenseacat: error added https://gist.github.com/wrknck/d704dee93ecf1a161905 i added note to point to actual line
[13:06:32] worknick: sevenseacat: recently i even added validates_presence_of :user to comments model
[13:06:50] worknick: sevenseacat: the main thing is, all this was working before. suddenly something broke.
[13:07:04] worknick: sevenseacat: in another error if i remove the id part and reload.
[13:09:40] worknick: sevenseacat: now its not acceping comment because i added the validation. so basically user_id is not provided. troubleshooing it.
[13:10:34] worknick: sevenseacat: how can i print the troubleshooting msgs directrly from my controller to some file?
[13:13:29] worknick: sevenseacat: any freenode issue today?
[14:04:51] worknick: Quit: WeeChat 1.4

2016-02-22

[05:56:48] worknick: has joined #RubyOnRails
[05:57:39] worknick: i have a pop up notification div and on click i am trying to append new notification page to it by $("<%=j #{render(:partial=>'shared/notification', :locals=>{:notification=>@notifications})}%>").appendTo('#notificationsBody'); which appends this code itself instead of result
[06:04:36] worknick: yes. application.js
[06:04:58] worknick: sevenseacat: its not a sperate .html.erb its just a div inside application.html.erb.
[06:05:07] worknick: i have append to thav "div" not to "page"
[06:06:14] worknick: js.erb for application.html.erb is application.js!! right?
[06:08:05] worknick: Radar: but in this specific case i am not using js.erb?
[06:08:43] worknick: Radar: cause its not inside any .js.erb file? its anside application.js?
[06:09:33] worknick: so, how do i append the next page of kaminari to that div?
[06:09:39] worknick: whats the recommended way?
[06:09:57] worknick: ok. let me check.
[06:14:47] worknick: Arcaire: your point is to , recommend to , not use every other js ? or use it?
[06:14:56] worknick: i dotn get what that quote means.
[06:16:30] worknick: Arcaire: ok
[06:48:10] worknick: can i have kaminary to give random pages on each click?
[06:49:18] worknick: no. but i would like my users to give random suggestions.
[06:49:44] worknick: so its done inside .wher clause only and not at kaminari level+
[06:49:54] worknick: .order i mean
[06:50:43] worknick: sevenseacat: shall i do order by radnom?
[06:51:21] worknick: right. thanks.
[08:05:28] worknick: where to put the pluck? current_user.notifications.pluck(:id).order('created_at DESC').page(params[:page]).per(3)
[08:06:33] worknick: i want single column. not all columns.
[08:16:29] worknick: rvanlieshout: it was just for test. now i removed it.
[10:38:22] worknick: how can i troubleshoot if <%= link_to link click does nothing? if i go to source and from there click on the lirk it gives source of the new page (mean opens the new page)
[10:38:31] worknick: i even manually provided method=get
[10:45:14] worknick: sevenseacat: this is the code concerning this div https://gist.github.com/wrknck/e1c82cc78a2a0d7adddc
[10:46:04] worknick: sevenseacat: when user click on the glyphicon this div appears as popup. there are <%= link_to inside it. which dont do anything. i tried to put a test link <%= link_to user_path(currentuuser) there without partial and that simple link also wont do anything
[10:47:47] worknick: arup_r: there is nothingh. no error in firebug.
[10:47:52] worknick: sevenseacat: right.
[10:48:48] worknick: i am click on "nt.desc" which is inside _notification.html.erb
[10:49:16] worknick: sevenseacat: ???
[10:50:01] worknick: "without partial" is what i said
[10:50:38] worknick: i have a normal link -> yes.
[10:50:52] worknick: its jusst <%= link_to i am not manipulating that link from js.
[10:51:01] worknick: sevenseacat: its not there.
[10:51:15] worknick: arup_r: since it was not working i thought to give it manually
[10:51:39] worknick: sevenseacat: this div is not a dialog box.
[10:52:42] worknick: yes. pop up which i created manuly. not using jquery ui dialog.
[10:55:03] worknick: arup_r: some js might be causing trouble i will check it. but its not preventdefault.
[10:56:40] worknick: it was click event on the main div of that notificaiton which was returning false!
[10:57:48] worknick: ACTION hugs arup_r
[14:24:37] worknick: i tried this <%= p.input :actimg, :label=>nil, as: :file, :input_html => { :value => '1.jpg' }, :required => true%> to make paperlclip upload button not have any label. but it still print the model column name.
[14:33:30] worknick: durexlw: hi
[14:56:37] worknick: any idea on hiding papercrlip upload button label?
[15:06:43] worknick: arup_r: ping you there?
[17:21:03] worknick: anyone using http://plugins.krajee.com/star-rating
[18:21:28] worknick: Quit: WeeChat 1.4

2016-02-21

[14:54:04] worknick: has joined #RubyOnRails
[14:54:17] worknick: is there anything builtin in devise to prevent email modification?
[14:54:32] worknick: and some other custom field modification. only password change is to be allowed.
[15:05:19] worknick: sevenseacat: but email needs to be there in permitted params for sign up action. wont it conflict there?
[15:06:40] worknick: i understood about removing it from form.
[15:06:44] worknick: but also said to remove it from params.
[15:06:56] worknick: i dont have custome controller for devise then where do i remove that params?
[15:09:06] worknick: sevenseacat: ok
[15:16:34] worknick: sevenseacat: this line devise_parameter_sanitizer.for(:sign_up) << :firstname, :lastname, :city, :state, :country, :aboutme gives me error syntax error, unexpected ',', expecting keyword_end ...er.for(:sign_up) << :firstname, :lastname, :city, :state, :c... ... ^
[16:24:26] worknick: Quit: WeeChat 1.4

2016-02-20

[09:30:19] worknick: has joined #RubyOnRails
[09:31:03] worknick: i have notification div on navbar li. it appears when user click on icon. bootstrap navbar is overriding my text decoration setting for this div. how to stop it from overriding so that i can apply my own css to it?
[09:34:48] worknick: tbuehlmann: will try there. thanks.
[10:40:02] worknick: what can i do to make form in jquery ui dialog work ? the submit button dont do anything.
[14:59:09] worknick: i created jquery ui dialog boxes for edit and cerate form. edit works without any modification. but create action form submit button wont to anything.
[14:59:47] worknick: whats the difference between edit and create inside dialog box?
[15:08:01] worknick: arup_r: i just deleted it and replaced everything. i will memoserv you later when i get it back.
[15:25:57] worknick: Quit: WeeChat 1.4

2016-02-19

[12:48:59] worknick: has joined #RubyOnRails
[12:49:57] worknick: Can user "and" for var.where.not(:user_id=>currentuser and :user_id=>someothervar.id)
[17:13:24] worknick: i am using div to store notification. when user clicks, it will give pop up and show notification. how can i make this div and its span not occupy any space on the nav bar ?
[19:11:16] worknick: Quit: WeeChat 1.4

2016-02-17

[09:50:01] worknick: Quit: WeeChat 1.4