|
Is there a way to stop pending migrations from being run when I do rake db:seed or a way to run my own .rb files using rake?
KoRMaK fucked around with this message at 17:46 on Mar 1, 2013 |
# ¿ Mar 1, 2013 17:12 |
|
|
# ¿ Apr 29, 2024 03:37 |
|
I have three questions: 1) I want to put a :limit clause on a relationship using a variable from the same class, like this (but it doesn't work). Ruby code:
Ruby code:
Ruby code:
|
# ¿ Mar 13, 2013 14:03 |
|
A MIRACLE posted:is `things_limit` a class method or an instance method? I think this might only work with class methods. I'm still taking in and processing the other couple of comments from you guys, thanks for the replies.
|
# ¿ Mar 13, 2013 15:45 |
|
I am building a file attachment system. I know there are gems out there that do this, but I'm doing it by hand. Things are going well, I have successfully saved the data into the database (yes, into the DB) and successfully retrieved it and delivering it to the user via web browser. My question is how do I read that file back into an object that I can then do file.content_type on? I'm running into wierd problems where ruby complains that it is a string and not a file or something. Ruby code:
|
# ¿ Mar 27, 2013 17:54 |
|
I actually don't have any compelling evidence to use to convince the team against it, so I am complicit. Even if I do get evidence against it, I'd still like to know how to solve my problem as a learning exercise.
|
# ¿ Mar 27, 2013 19:59 |
|
This is killing me: I have a file upload in a modal that I want to submit via js but once I add the file to the form the form submits as HTML and not js. I've been tryin to find and explanation of what is going on but nothing really explains this process beyond "magic iframe" I've tred watching the form event listeners and I are no change between the modal submitting with or without a file. Can someone point me to a guide or even a debugging tip for how to see what is going on? E: screw it, I'll use someone else solution https://github.com/JangoSteve/remotipart worked in like less than a minute. I guess if I want to know what is going on I can explore its code KoRMaK fucked around with this message at 20:43 on Apr 10, 2013 |
# ¿ Apr 10, 2013 19:54 |
|
How do I specifiy the namespace (not sure what to call it in ruby or rails, I'm using it as if this were java or C#) of a variable I am using? I have a local variable that is getting in the way of a similar one in a module. Is there a way I can delineate between the two? I have had the same problem with a definition in the application helper override a model's scope definition. Similar problem, I have overridden I18n.t in my application helper but when I try to call it from the application helper file it uses the default I18n.t version instead of the one I wrote. Doing ApplicationHelper.t gets me the right one, but it loses the context of my current_account variable which I need t to be aware of. KoRMaK fucked around with this message at 16:56 on Apr 23, 2013 |
# ¿ Apr 23, 2013 15:02 |
|
I want to override the I18n::translate method for my whole app. Why? Because the default scaffolded views use the f.label method and that calls translate and I want translate to conform to our special locale system. Normally it pulls the labels from the en.yml file under helpers.label.model.field I need to also have it check another location.
|
# ¿ May 8, 2013 15:05 |
|
Cocoa Crispies posted:It depends on the app server you use, and if your Rails stack is loading Rack::Lock.
|
# ¿ May 31, 2013 21:16 |
|
I'm confused. Use Jquery's ajax or better yet add :remote => true to your form and allow the controller to respond to js requests.
|
# ¿ Jun 6, 2013 01:47 |
|
How would I dynamically add an after filter based on the conditional of whether an instance method exists? I am making a module that attachs to controllers and I want to add an after filter to a method only If said method exists
|
# ¿ Jun 12, 2013 18:44 |
|
I would think that should work, but the class doesn't have the method in its class methods at te time the module gets run. So it's like the method doesn't exist for me to put a filter on.
KoRMaK fucked around with this message at 19:22 on Jun 12, 2013 |
# ¿ Jun 12, 2013 19:19 |
|
Why not? It will be better this way than editing 30 files to conform. KoRMaK fucked around with this message at 19:37 on Jun 12, 2013 |
# ¿ Jun 12, 2013 19:33 |
|
C'mon Don't logic some sense into me. I sill think it be useful to add filters from a module. Wait, adding a filter on that function inside the controller doesn't work either. I should go read up on filters. E: wtf filters only get run on the methods that are called during routing? I added my before filter to edit, instea of a function that gets called by edit, and it started to work. I guess I had a fundamental misunderstanding of when filters are run. KoRMaK fucked around with this message at 23:06 on Jun 12, 2013 |
# ¿ Jun 12, 2013 19:47 |
|
Is there an editor or eclipse plugin that will open the other 2 files of a ror object when I open 1? I want to open the beer form view and have the model and controller open in editor windows for it automatically. I am now in the realm of shaving off repetitive tasks that take seconds because of their cost over a career-time. And I am lazy. I mean efficient.
|
# ¿ Jun 13, 2013 14:44 |
|
Cocoa Crispies posted:It's not "ror" unless you're a recruiter, it's "Rails." Objects only usually have one file. Just because the scaffold generator makes files with similar names doesn't mean they have to be related. Rails object in my post meant a rails scaffolded set of views a controller and a model centered around one name working in conjunction with each other. I'd still want the option for the model and controller to open up when I open a view when appropriate. KoRMaK fucked around with this message at 18:02 on Jun 13, 2013 |
# ¿ Jun 13, 2013 18:00 |
|
shdwdmg posted:A bit late to the party, but realistically speaking I am looking for a career change. I have some programming experience from HS, but opted for a stupid Liberal Arts Degree that has offered dismal opportunities.
|
# ¿ Jun 21, 2013 22:25 |
|
That's how you do it. I've recently upgraded our file with a similar parent chaining with added consideration if the parent isn't attached yet.
|
# ¿ Jun 26, 2013 21:00 |
|
I have two objects/tables, Persons and feed_entries. A person can have multiple feed_entries. I want to set the default_scope for Persons so that it orders DESC by the "last_updated" method which is defined below on person.rbRuby code:
Ruby code:
Ruby code:
KoRMaK fucked around with this message at 22:48 on Jun 27, 2013 |
# ¿ Jun 27, 2013 20:46 |
|
Yes that makes so much sense. Way more rails than whatever I was envisioning.
|
# ¿ Jun 28, 2013 13:50 |
|
Has anyone had to deal with devise's password reset in a multi tenantcy environment? Devise is only looking for users by email, I need email and account_id in my user load query. I'm going through the devise library and feels like I'm getting close but there has got to be someone else that has had this issue. I'm currently overriding the devise password controllers create method but by the time it gets to user.find first by auth conditions it has forgotten the account id I am passing in.
|
# ¿ Jun 28, 2013 21:31 |
|
Molten Llama posted:How'd you set Devise up in your initializer? If you haven't already tweaked your config.authentication_keys and config.request_keys, start there and the rest should fall into place a lot more quickly and obviously.
|
# ¿ Jun 28, 2013 22:26 |
|
I have a namespace in my routes. Pages in that namespace are not having the application.js compiled for them. What are things I should be considering when when it comes to namespaced routes and the asset pipeline?
|
# ¿ Jul 12, 2013 16:53 |
|
The thing you are looking for does not exist in the params hash.
|
# ¿ Jul 16, 2013 20:55 |
|
raej posted:Am I setting this whole form up wrong then? Here's an example of what my params look like on a form submit: Ruby code:
|
# ¿ Jul 16, 2013 21:23 |
|
We usually put ours in a migration so that when it gets to production we just run it. It's been tested in 2 or 3 environments before it gets to there and it has worked reliably. e: I guess when I use it, it's a little different than what you are intending. But I'd give it a try.
|
# ¿ Jul 17, 2013 04:04 |
|
Instead of writing that as SQL I would have written it as a ruby loop. e: inside of the migration. Like this Ruby code:
KoRMaK fucked around with this message at 17:04 on Jul 17, 2013 |
# ¿ Jul 17, 2013 16:44 |
|
How do you switch the version on api.rubyonrails.org? I need to look at an older version. Right now its stuck at 4
|
# ¿ Jul 18, 2013 21:06 |
|
Molten Llama posted:Tack on v and the version you'd like, e.g. http://api.rubyonrails.org/v3.2.13/. I integrated SAML SSO today with Onelogin's kit. It wasn't that bad.
|
# ¿ Jul 19, 2013 02:30 |
|
Somehow Eclipse just knows where to find the info for content assist. I'm guessing it uses my rvm gem settings (I'm on windows) to figure out where the gem library is. I'd like to switch this to a different directory which resides on a network drive. Has anyone had experience with this?
|
# ¿ Jul 30, 2013 19:28 |
|
I want to host a portfolio app thats just a small demo of an idea on the Internet for as cheap as possible. It seems like heroku might have a free option. Am I understanding that correctly?
KoRMaK fucked around with this message at 05:41 on Sep 15, 2013 |
# ¿ Sep 15, 2013 05:19 |
|
kayakyakr posted:e: ^^^ github pages are also good for static apps. It's http://nestacms.com/ on the back end if i'm not mistaken.
|
# ¿ Sep 15, 2013 05:42 |
|
Just deployed to heroku. Things are going ok, but when I created the app locally it was for mysql. Now I am trying to switch to postgreSQL. The heroku documentation says my database.yml file gets overwritten with the right info, but it doesn't seem to be working.code:
|
# ¿ Sep 18, 2013 05:23 |
|
Oh My Science posted:https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting The backgrounds for the other slides in the carousel bootstrap layout don't load. I'm not sure whats up with that.
|
# ¿ Sep 18, 2013 17:55 |
|
I learned the importance of "require jquery_ujs". I thought it was jquery_uis which would be a redundant include. The it dawned on me "ujs = unobstrusive javascript." It's got what remote forms crave. I spent an hour trying to figure out why my :remote => true form submit's were refusing to submit as js.
|
# ¿ Sep 19, 2013 20:24 |
|
I'm starting my first app from scratch. I have about 2 years in on another project that I inherited after it was setup with a custom config. There isn't really a problem, but I notice a difference when I scaffold. With my new app the models have all their variables mentioned via attr_accessible. The other app doesn't do this. The only time it does is for when something gets added to the account model. My guess is that the account model was made before the gem or config option that controls this. Can anyone suggest what gem/option controls this?
|
# ¿ Oct 3, 2013 00:20 |
|
Ruby 1.9.2, Rails 3.2.13. They both have that in common. Strong Parameters doesn't look familiar. The older project inherits a proprietary setup called Rails Saas kit so maybe its from that.
KoRMaK fucked around with this message at 01:10 on Oct 3, 2013 |
# ¿ Oct 3, 2013 01:06 |
|
But why does one do it and not the other.
|
# ¿ Oct 3, 2013 03:47 |
|
In Ruby, I have a ASCII-8bit stream that contains a xls workbook. I want to open the workbook via the Workbook gem, but it requires a file. Is there a way I can read the stream into a file object without actually writing it to disk? This link seems close to what I am trying http://stackoverflow.com/questions/5931263/memory-streams-in-ruby e: I tried it and it almost works. The Workbook gem tries to do a rewind on it, and I get an "Illegal Seek" error. https://github.com/zdavatz/spreadsheet/blob/master/lib/spreadsheet/excel/reader.rb#L1198 KoRMaK fucked around with this message at 21:02 on Nov 8, 2013 |
# ¿ Nov 8, 2013 20:27 |
|
|
# ¿ Apr 29, 2024 03:37 |
|
Soup in a Bag posted:If you want to read the entire stream in and then use it as if it were a file, check out StringIO. It responds to #rewind and all the other File/IO-ish methods. Now I have a public staging/development area and a production are on heroku. Heroku offers a nice easy way to manage which app you are managing. I needed to get my DB up and it just requires adding -app APPNAME at the end of the commands. I have another problem with an app I've already deployed to heroku that I am creating a new instance of and for some reason it fails at the assets:precompile step. Here's the push log I get code:
e: Fixed! There was a comma where a semi-colon should have been in bootstrap.css. When I run rake assets:precompile locally I get this quote:Text file busy - (/media/sf_clunker/tmp/cache/sass/1764c37ed8cf48e1638694abf11caad17c086877/gritter.css.scssc20131110-2125-a7ip2g, /media/sf_clunker/tmp/cache/sass/1764c37ed8cf48e1638694abf11caad17c086877/gritter.css.scssc) Text file busy? KoRMaK fucked around with this message at 05:41 on Nov 11, 2013 |
# ¿ Nov 11, 2013 04:36 |