oscarb92

Activity Graph

Page 1 of 1

2015-12-03

[22:09:44] oscarb92: has joined #RubyOnRails
[22:11:40] oscarb92: hello, what would be an appropiate strategy to deploy a rails 4.1.8 app to Windows Server?
[22:21:21] oscarb92: tubbo: right, thank you, very helpful
[22:29:31] oscarb92: Radar: yes, I was building a Rails project for a company with Windows Servers. It needs to be deployed on those servers. I've tried using something called Helicon Zoo for the IIS, and it successfully create a server for a rails application, but is supports Ruby 1.9 (my rails project uses Ruby 2.1)
[23:24:06] oscarb92: Radar: YEah I'm starting to consider that
[23:30:08] oscarb92: Quit: Page closed

2015-11-08

[21:11:16] oscarb92: has joined #RubyOnRails
[21:15:51] oscarb92: Ping timeout: 246 seconds

2015-11-06

[07:10:57] oscarb92: has joined #RubyOnRails
[07:15:57] oscarb92: hello, I'm trying to do a raw query with ActiveRecord::Base.connection.execute(query), but it returns a fixnum with the number of rows instead of the rows themselves
[07:18:47] oscarb92: sevenseacat: I've tried several queries and it always returns the number of rows
[07:20:13] oscarb92: sevenseacat: "select * from any_table" returns the number of rows
[07:20:59] oscarb92: sevenseacat: well, it returns a fixnum, which is the number of rows
[07:21:23] oscarb92: sevenseacat: Yes, that's an example
[07:22:29] oscarb92: sevenseacat: https://gist.github.com/OscarBastardo/35377293c82e20d6ca68#file-query-sql
[07:23:01] oscarb92: sevenseacat: sql_server adapter
[07:24:43] oscarb92: rvalienshout: It works in the db management studio :/, is it adaptable to ActiveRecord query?
[07:26:06] oscarb92: rvanlieshout: it returns a fixnum, not a stream
[07:29:33] oscarb92: sevenseacat: what?
[07:30:18] oscarb92: rvanlieshout: can't seem to find anything related to that https://github.com/rails-sqlserver/activerecord-sqlserver-adapter
[07:37:53] oscarb92: Ok, I should adapt the sql to the activerecord then
[08:07:34] oscarb92: Quit: Page closed

2015-11-04

[06:18:58] oscarb92: has joined #RubyOnRails
[06:25:09] oscarb92: Ping timeout: 246 seconds
[07:34:03] oscarb92: has joined #RubyOnRails
[07:36:43] oscarb92: hello, how can I group an ActiveRecord result ignoring the differents ids of the records?
[07:40:01] oscarb92: objects made at the same time by a user, I want to show them in a table as a single element (those with the same attributes but the ids should become a single row)
[07:40:10] oscarb92: ravnlieshout
[07:43:26] oscarb92: https://gist.github.com/OscarBastardo/c9ed83a3c1e4d5d90d8c
[07:43:30] oscarb92: ravnlieshout
[07:49:33] oscarb92: ravnlieshout a medico should be able to make a @reprogramacion_cita, but they are also related to many patients, so I made a table to store a reprogramacion made by a single doctor to many pacientes through an appointment
[07:51:19] oscarb92: ravnlieshout there is a column for each reprogramacion for each patient through appointments
[07:52:08] oscarb92: i want to group the patientes reprogramados at the same time as a single row
[07:52:25] oscarb92: havent tried to use plain sql
[07:52:35] oscarb92: I think I should consider it now
[07:58:20] oscarb92: https://gist.github.com/OscarBastardo/c9ed83a3c1e4d5d90d8c#file-schema-rb
[07:59:54] oscarb92: chech at the table at the schema.rb rvanlieshout, for a group of dates the attributes will be the same except for the id
[08:02:14] oscarb92: krzkrz: fecha_hora_anterior
[08:46:58] oscarb92: Quit: Page closed

2015-11-03

[21:05:51] oscarb92: has joined #RubyOnRails
[21:06:51] oscarb92: Question, how can I find records by a datetime having a string as input and datetime field in a table from a SQL Server DB
[21:10:22] oscarb92: https://gist.github.com/OscarBastardo/c9ed83a3c1e4d5d90d8c citas_reprogramar gets 0 values
[21:11:02] oscarb92: I tried Time.parse(params[:fecha_hora_anterior]) and it does it correctly
[21:18:38] oscarb92: smathy: no, neither works
[21:21:05] oscarb92: smathy: yes it is, and params[:fecha_hora_anterior] is a string like '2015-11-05 11:00:00'
[21:21:11] oscarb92: if that means anything
[21:21:56] oscarb92: smathy I'm sure there are records that match the condition
[21:26:54] oscarb92: smathy: it's working now, it was a conflict with the timezone
[21:27:03] oscarb92: smathy: thank you :)
[22:05:00] oscarb92: Ping timeout: 246 seconds

2015-10-30

[16:22:41] oscarb92: has joined #RubyOnRails
[16:28:04] oscarb92: hello, I'm having a weird issue with a model object, when I assign it to a variable to fill it in a form with @model = Model.new it returns an object to the view with no attributes (instead of nil attributes)
[16:42:16] oscarb92: smathy: it does the same thing
[16:49:49] oscarb92: smathy bricker helpa https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0
[16:54:16] oscarb92: smathy https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0#file-console-rep
[16:59:10] oscarb92: smathy I just followed Rails conventions and they worked
[16:59:32] oscarb92: smathy though I think it might be a pluralization issue because of the spanishy model name
[17:00:00] oscarb92: smathy, it does
[17:00:54] oscarb92: smathy that should be the exact table name?
[17:01:16] oscarb92: it's singular :o
[17:04:03] oscarb92: smathy: ok, thank you very much
[17:08:15] oscarb92: Ping timeout: 246 seconds

2015-10-29

[21:31:08] oscarb92: has joined #RubyOnRails
[21:32:22] oscarb92: Hello, how can I compare a datetime I created with DateTime.new() with a datetime from a model?
[21:34:31] oscarb92: rhizome: Model.where(stored_datetime: my_datetime) but it returns this error 'The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value'
[21:35:44] oscarb92: rhizome: no, sorry that is the error I get when I try to format the datetime with strftime
[21:36:30] oscarb92: if i just pass the datetime no results are found (and it definitely should find matching data)
[21:37:21] oscarb92: smathy: yes.
[21:37:42] oscarb92: rhizome: it is a datetime
[21:40:04] oscarb92: rhizome: https://gist.github.com/OscarBastardo/b4d28088acdc9cf3c483
[21:47:22] oscarb92: rhizome: yes, there are entries in the db that match de criteria
[21:53:36] oscarb92: Ping timeout: 246 seconds

2015-10-26

[00:15:35] oscarb92: has joined #RubyOnRails
[00:16:56] oscarb92: hello, I'm getting this error for "undefined method `[]' for nil:NilClass" for this line of code "<%= simple_form_for @reprogramacion_citas, url: reprogramacion_citas_path do |f| %>"
[00:17:44] oscarb92: in the controller new action I initialize that variable as "@reprogramacion_citas = ReprogramacionCita.new"
[00:18:17] oscarb92: But that object seems to be empty, not like other new model objects that contains keys with attrs names and nil values
[00:25:11] oscarb92: Radar: https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0
[00:27:56] oscarb92: sevenseacat: I know, but why? I assign it a ReprogramacionCita.new
[00:29:01] oscarb92: sevenseacat: I fixed it. Still not working
[00:32:55] oscarb92: sevenseacat: Any other idea? It's not the variable name, that was a typo when creating the gist
[00:33:57] oscarb92: sevenseacat: by making it a bit more readable to english speakers such as yourself
[00:35:13] oscarb92: sevenseacat: Not to be umpolite, but is this going anywhere?
[00:36:36] oscarb92: sevenseacat: I'm telling you it's not the variable name. Do you know what else could it be? If I check the variable it seems to be an object from the model, but it doesn't have the nil attributes as the other ones then I use the .new
[01:01:59] oscarb92: matthewd: nothing weird (added it to the gist) https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0/edit
[01:03:04] oscarb92: matthewd: sorry wrong link https://gist.github.com/OscarBastardo/f31e3bbb2a1ac0bd63b0
[01:03:55] oscarb92: matthewd: I'm not overriding initialize (don't even know what that is in the model)
[01:10:58] oscarb92: sevenseacat: yes it does. Created it with migrations
[01:11:59] oscarb92: sevenseacat: yes, I can see the table in the database
[01:18:24] oscarb92: Ping timeout: 246 seconds
[01:36:21] oscarb92: has joined #RubyOnRails
[06:54:26] oscarb92: hey people, I'm using jquery ui autocomplete gem https://github.com/peterwillcn/rails4-autocomplete. It's working but the results are showing like unformatted li elements
[06:55:00] oscarb92: what could possibly cause this?
[06:56:44] oscarb92: sevenseacat: :o totally forgot, thanks
[06:57:36] oscarb92: sevenseacat: you're right, I missed the css
[08:23:39] oscarb92: Ping timeout: 246 seconds

2015-10-18

[16:38:45] oscarb92: has joined #RubyOnRails
[16:41:14] oscarb92: hello, I'm working with RoR 4.1.8 on Windows. I'm having trouble with the JS assets since they are not updating as I run the project in development. I've tried rake cleaning and precompiling the assets, but it doesn't seem to work
[16:42:48] oscarb92: I suspect it has something to do with the fact that I've been changing the system time and date to test appointment features on my app
[17:35:52] oscarb92: hello, I'm working with RoR 4.1.8 on Windows. I'm having trouble with the JS assets since they are not updating as I run the project in development. I've tried rake cleaning and precompiling the assets, but it doesn't seem to work
[17:36:07] oscarb92: I suspect it has something to do with the fact that I've been changing the system time and date to test appointment features on my app
[18:08:22] oscarb92: Quit: Page closed

2015-09-17

[20:32:11] oscarb92: has joined #RubyOnRails
[21:45:34] oscarb92: Ping timeout: 246 seconds

2015-09-07

[14:45:25] oscarb92: has joined #RubyOnRails
[14:45:40] oscarb92: nickserv /identify oscarb92 20506388
[14:46:11] oscarb92: Disconnected by services
[15:00:21] oscarb92: has joined #RubyOnRails
[15:03:38] oscarb92: Would you recommend a gem to manage a daily events calendar with rails? say doctors appointments schedule
[15:04:50] oscarb92: Or any compatible front end solution?
[15:09:46] oscarb92: astrodog: I'm building a scheduling app for a health center. First I'd like to save each doctor's particular schedule (schedule table) and then I'd like to display to the patients who search for a specific doctor her schedule and let them assign an appointment (appointments table)
[15:10:35] oscarb92: astrodog: the tables store datetime fields
[15:17:05] oscarb92: astrodog: help me build the calendar in html and setup parameters, send formatted data to the controller, restrict some actions in the view, maybe?
[15:41:58] oscarb92: astrodog: http://fullcalendar.io/docs/ something like this would work with calendar_helper?
[16:45:13] oscarb92: Ping timeout: 246 seconds

2015-08-31

[20:55:30] oscarb92: has joined #RubyOnRails
[20:59:24] oscarb92: I need to access an attribute from an association within a loop in the view (for each instance of the list of objects I need to find an attribute from its associated model). It seems that is not possible to use ActiveRecord in the view. How can I achieve that?
[21:37:07] oscarb92: Ping timeout: 246 seconds

2015-08-28

[03:07:19] oscarb92: has joined #RubyOnRails
[03:09:34] oscarb92: hello. I'm new to rails and I'm using cocoon gem to add dynamic fields to a nested model, but I'm not sure what to do in the controllers to save the new objects. I know you have to run the model.nested_model.build method in order to save a new instance, but I'm not sure how to apply it in this case.
[03:20:12] oscarb92: dnewkerk: heyyy... yes
[03:21:00] oscarb92: dnewkerk: well, when I add the new inputs and send the form it does not save them to the db
[03:22:15] oscarb92: dnewkerk: nope :/
[03:24:32] oscarb92: dnewkerk: it looks great, youre using ajax, though. Awesome :D
[03:25:35] oscarb92: dnewkerk: hmm well I'm using a SQL server db. Maybe I could use the migrations to make a sqlite db instance
[03:28:00] oscarb92: dnewkerk: yes, well, the one I'm running the server with
[03:28:30] oscarb92: dnewkerk: oh wait, that's another log, isn't it?
[03:37:11] oscarb92: dnewkerk: well, I don't see anything like that. Another thing, I'm actually in an edit/update form, let's say I want to add basic info in the new/create form, and then add that detail in the edit/update
[03:37:31] oscarb92: dnewkerk: could it be something related to that?
[03:42:28] oscarb92: dnewkerk: ok... let me add it to the gist. No, I haven't changed it and It works for updating the fields that already exist and deleting
[03:43:06] oscarb92: dnewkerk: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 it's there
[03:57:33] oscarb92: dnewkerk: oh yes, I added the save to try something out
[03:58:10] oscarb92: dnewkerk: oh right. That I fixed it earlier
[03:58:15] oscarb92: let me update that code
[03:59:27] oscarb92: dnewkerk: I was having trouble with that early but I fixed it
[04:05:36] oscarb92: dnewkerk: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 Parameters file
[04:07:20] oscarb92: dnewkerk: those last attributes are 2 experiencias_laborales already in the database
[04:20:01] oscarb92: Ping timeout: 246 seconds
[04:24:17] oscarb92: has joined #RubyOnRails
[04:26:49] oscarb92: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43
[04:28:13] oscarb92: dnewkerk: yes, I was trying something out with JS
[04:28:30] oscarb92: already deleted it, it didn't work
[04:30:08] oscarb92: dnewkerk: the POST file in the gist have the parameters the form sends
[04:30:22] oscarb92: dnewkerk: yes... but they don't appear in the submit
[04:30:31] oscarb92: dnewkerk: yes... but they don't appear in the params*
[04:37:59] oscarb92: sevenseacat: I'm adding dynamic fields to my edit view, but when I fill them and send them to the update method, those nested attributes are not being saved into the database
[04:38:24] oscarb92: sevenseacat: they don't even appear in the params
[04:39:03] oscarb92: sevenseacat: those are the ones already saved in the database
[04:39:35] oscarb92: but when I add new fields with the cocoon gem (javascript) they are not sent over the request
[04:40:46] oscarb92: dnewkerk: I'm not very experienced with tests (I know, bad practice) u.u
[04:41:11] oscarb92: sevenseacat: you want to see a sample of the html?
[04:43:07] oscarb92: sevenseacat, dnewkerk: here https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 sample.html
[04:45:42] oscarb92: sevenseacat: yes, plain submission. Not ajax or anything like that
[04:46:16] oscarb92: a little bit of info: im using rails 4.1.8
[04:47:57] oscarb92: dnewkerk: well, not quite. the form closes wayy up in the html, because I have fields in different columns (bootstrap) and it closes when the 1st column ends
[04:48:25] oscarb92: sevenseacat, dnewkerk: oh damn... well, I do use javascript to submit, now that I recall...
[04:49:25] oscarb92: sevenseacat, dnewkerk: i had this issue that the submit button wouldnt work because of that, but if I used jquery to submit on the click of that button it works
[04:49:32] oscarb92: and thats how I do it
[04:50:16] oscarb92: sevenseacat: yea that's what I read
[04:51:15] oscarb92: anyhow, I used that workaround because I couldn't figure out how to close it at the very end using rails form_helper
[04:58:02] oscarb92: sevenseacat: Oh, you're right. I'm sorry.
[04:58:35] oscarb92: sevenseacat: are you a lady, then? (friendly question)
[05:00:34] oscarb92: hello, EvilEpoch
[05:01:13] oscarb92: the EvilEpoch has a point
[05:02:14] oscarb92: people, do you think it is redundant to have mvc frameworks on both the front and the backend?
[05:07:46] oscarb92: well, my colleagues that work with front end usually use angular + some restful api... or a django/rails app with a lightweight front (bootstrap, jquery)
[05:08:56] oscarb92: dnewkerk: I found that article yesterday and added it to my browser bookmarks... gotta check it out, definitely
[05:17:17] oscarb92: dnewkerk: Interesting. I'll get some more experience with rails and then try out some of those approaches
[05:21:12] oscarb92: dnewkerk: I understand. I have tried angular a little bit, but it has been enough to consider my indiscriminate use of jQuery
[05:23:10] oscarb92: dnewkerk: oh, I have some reading material now, haha. Thanks.
[05:23:34] oscarb92: bye people. As usual thank you for your help.
[05:24:11] oscarb92: Quit: Page closed

2015-08-27

[01:32:22] oscarb92: has joined #RubyOnRails
[01:34:44] oscarb92: hello, any ideas on why a _destroy attribute is not being sent in the parameters to the controller? I'm not able to delete my nested associations. Here's my view: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43
[01:36:22] oscarb92: sevenseacat: sorry I forgot to mention I'm using this gem https://github.com/ncri/nested_form_fields to generate the dynamic fields
[01:45:14] oscarb92: sevenseacat: if I update a field it sends the ones you add with the helper plus the id
[01:51:43] oscarb92: sevenseacat: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 parameters.json
[03:07:28] oscarb92: dnewkerk: no :(
[03:07:33] oscarb92: dnewkerk: let me show you
[03:11:53] oscarb92: dnewkerk: I'd appreciate it :) https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 it's the medicos_controller.rb file
[03:22:28] oscarb92: dnewkerk: html?
[03:30:39] oscarb92: dnewkerk: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 is the view-output.html file
[03:30:46] oscarb92: dnewkerk: yes
[03:31:05] oscarb92: dnewkerk: There you can see two dynamic fieldsets and the input for the deleted one
[03:41:15] oscarb92: dnewkerk: sorry I got a call
[03:42:46] oscarb92: dnewkerk: To answer your first question, that's because there is only one medico for usuario (it's a has_one relationship)
[03:43:32] oscarb92: dnewkerk: usuario has one medico and medico has many experiencias laborales
[03:44:21] oscarb92: dnewkerk: haha it's ok... It's a pain but having the tables in spanish is a requirement
[03:45:39] oscarb92: dnewkerk: I have configured accept_nested_attributes_for :medico, in usuario model and _for :experiencia_laborals in medico model, both with allow_destroy: true
[03:58:19] oscarb92: dnewkerk: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43 POST file... basically what you see in params in the controller :/
[03:58:53] oscarb92: dnewkerk: no _destroy parameter :/
[04:02:03] oscarb92: dnewkerk: I feel so temped to do it some other way, but I know I'll regret later not playing by the rules
[04:11:36] oscarb92: dnewkerk: because the has_one relationship is between usuario and medico, but I'm using it for the multiple experiencia_laborals that one medico can have
[04:16:03] oscarb92: dnewkerk: is it not the one after [experiencia_laboral_attributes] ?
[04:16:43] oscarb92: dnewkerk: usuario[medico_attributes][experiencia_laboral_attributes][0][id]
[04:24:15] oscarb92: dnewkerk: Sorry, but I think there is just one, since usuario has_one medico
[04:26:07] oscarb92: dnewkerk: well, at this point I'm questioning my thoughts, so what do you suggest, my friend?
[04:28:26] oscarb92: dnewkerk: but what does the last index mean then? :/
[04:49:44] oscarb92: dnewkerk: Yes, it does make sense after all
[04:55:54] oscarb92: dnewkerk: it sends the same data as if the JS were enabled
[05:01:44] oscarb92: dnewkerk: the gem properties won't work. Meaning the button to delete fields and the add new fields button do nothing
[05:02:32] oscarb92: dnewkerk: so there is no way to set an attribute to _destroy an experiencia_laboral
[05:05:30] oscarb92: dnewkerk: no, sorry :/
[05:07:11] oscarb92: dnewkerk: Yep, that's what I've been considering, switching to cocoon
[05:07:49] oscarb92: dnewkerk: I didn't want to because I didn't think it would be an issue with the gem
[05:09:59] oscarb92: dnewkerk: ok, I'll try it out. Thank you very much for your help :)
[05:22:46] oscarb92: Ping timeout: 246 seconds
[15:25:52] oscarb92: has joined #RubyOnRails
[15:29:51] oscarb92: hello, anyone with experience with cocoon gem? rails throws me an error for the link_to_add_association 'Association experiencia_laborals doesn't exist on ExperienciaLaboral' in edit.html.erb https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43
[15:32:40] oscarb92: it's like it is looking for the association for the model in the same model. I don't understand why, I'm doing it just like the example in the github readme https://github.com/nathanvda/cocoon
[16:33:43] oscarb92: Ping timeout: 246 seconds

2015-08-26

[15:23:04] oscarb92: has joined #RubyOnRails
[15:28:56] oscarb92: how can I define a _params.permit() hash that contains 3 level of nested attributes? Meaning, would this be correct? Because the fields from the 3rd level association are not saving to the DB and I'm not sure what could possibly be wrong
[15:29:00] oscarb92: https://gist.github.com/OscarBastardo/d7fb8a83aae7bb2a498a
[16:02:11] oscarb92: EllisTAA: I read it and then read this article http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters
[16:04:46] oscarb92: I think I get it and I changed the code to this ( adding the to the nested model attrs to note that there can be multiple in the form{}) but still does not save that data https://gist.github.com/OscarBastardo/d7fb8a83aae7bb2a498a
[16:05:46] oscarb92: Im using this gem to generate the dynamic inputs https://github.com/ncri/nested_form_fields
[17:23:31] oscarb92: Ping timeout: 246 seconds
[18:14:05] oscarb92: has joined #RubyOnRails
[18:17:23] oscarb92: Hello guys, I'm trying to save dynamic nested fields (2nd level association) using the nested_form_fields gem https://github.com/ncri/nested_form_fields but the nested elements for the deepest associations are not being sent when I submit the form. Here's the view: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43
[21:32:01] oscarb92: Ping timeout: 246 seconds

2015-08-25

[01:20:37] oscarb92: Quit: Page closed

2015-08-24

[23:34:47] oscarb92: has joined #RubyOnRails
[23:37:44] oscarb92: I'm wondering why my submit button is not working in my form when I load it with a link_to. Works when I copy the url directly into the browser. I use simple_form
[23:37:54] oscarb92: https://gist.github.com/OscarBastardo/265269bb47a4c30caad3
[23:38:45] oscarb92: Ropeney: hello :)
[23:42:27] oscarb92: Ropeney: in another page, I meant that when I load this page with a link_to, the submit button does not work, but it works if I use the url to get the page
[23:44:22] oscarb92: Ropeney: exactly
[23:45:58] oscarb92: Ropeney: at the home page... it looks like this: <%= link_to "M??dico", new_medico_path, class: "btn btn-lg btn-primary center-block" %>
[23:50:30] oscarb92: Ropeney: the button those not submit the form, it does not sent the post request, it does not call the create method in the controller, it does nothing when I click it
[23:51:47] oscarb92: Ropeney: that's the case when I load that page with the link_to, but when I load it with with the url it does work
[23:52:48] oscarb92: Radar: that's what I've been thinking... but the js code that I wrote works (input validations, datepicker), so I'm not sure
[23:55:00] oscarb92: Ropeney, Radar: ok, thank you guys

2015-07-21

[03:09:31] oscarb92: has joined #RubyOnRails
[03:12:11] oscarb92: Client Quit