|
rugbert posted:Is something going on with heroku? Im testing an site on it that works fine on my PC but breaks on heroku and heroku logs isnt giving me anything. For future problems with is it heroku or is it me, support.heroku.com gets updated almost immediately if there's anything wrong with the platform. Also speaking of logs, check out expanded logs heroku addons:upgrade logging:expanded, you can --tail them which is really awesome. I think expanded is free for everyone. but you default to basic.
|
# ? Apr 1, 2011 03:47 |
|
|
# ? May 14, 2024 20:25 |
|
Pardot posted:For future problems with is it heroku or is it me, support.heroku.com gets updated almost immediately if there's anything wrong with the platform. Awesome thanks, Im not seeing anything for another issue Im having where it takes a minute for my app to load so Im assuming thats normal.
|
# ? Apr 1, 2011 13:59 |
|
rugbert posted:Awesome thanks, Im not seeing anything for another issue Im having where it takes a minute for my app to load so Im assuming thats normal. Yeah, Heroku doesn't run every app all the time, they're spawned on demand.
|
# ? Apr 1, 2011 14:33 |
|
Only accounts without an additional dyno spin down. If you have at least one dyno, they always keep the application running and only spawn on demand for the second dyno.
|
# ? Apr 1, 2011 16:06 |
|
Also, how long it takes to spin up is mostly proportional to the slug size. And they're only spun down if there are no requests in some time period
Pardot fucked around with this message at 22:13 on Dec 8, 2013 |
# ? Apr 1, 2011 17:24 |
|
Pardot posted:Also, how long it takes to spin up is mostly proportional to the slug size. And they're only spun down if there are no requests in some time period so if you used some sort of uptime monitoring like pingdom or new relic's option, it probably wouldn't get spun down haha awesome. How would I write my controller to pull all blog posts that were created on or before the current date? Ive tried a couple things and get nothing, here's what I just tried code:
|
# ? Apr 2, 2011 03:28 |
|
rugbert posted:haha awesome. First thing alway use Time if you want to stay database agnostic you can do it this way. Note i recommend doing this inside a class method on the model so you can just call arel_table directly. i can provide an example if needed. Assuming rails 3 code:
This is also the easy way and non elegant way. code:
|
# ? Apr 2, 2011 03:43 |
|
rugbert posted:which gives me some error about how "now" is a private method.
|
# ? Apr 2, 2011 03:49 |
|
jetviper21 posted:This is also the easy way and non elegant way. code:
code:
|
# ? Apr 2, 2011 04:50 |
|
BonzoESC posted:Use a named scope, and put it on the model so you can test it. code:
|
# ? Apr 2, 2011 05:00 |
|
skidooer posted:Good advice, but you'll want to put that in a lambda, otherwise Time.now will be evaluated when the model loads and will not increment with the clock. Good call, but your tests should cover that
|
# ? Apr 2, 2011 05:29 |
|
skidooer posted:Good advice, but you'll want to put that in a lambda, otherwise Time.now will be evaluated when the model loads and will not increment with the clock. This is crazy and also a good post
|
# ? Apr 2, 2011 06:24 |
|
Regarding scopes and where chaining in Rails 3, is there really any significant advantage to using a scope over say:code:
|
# ? Apr 2, 2011 15:13 |
|
enki42 posted:Regarding scopes and where chaining in Rails 3, is there really any significant advantage to using a scope over say: Nope, and actually you shouldn't be using scopes anyway. http://www.railway.at/2010/03/09/named-scopes-are-dead/ And according to Aaron Patterson, lambdas are much slower than method calls anyway. (http://confreaks.net/videos/427-rubyconf2010-zomg-why-is-this-code-so-slow) around 28:00. But everyone should watch the whole thing.
|
# ? Apr 2, 2011 15:57 |
|
NotShadowStar posted:Nope, and actually you shouldn't be using scopes anyway. I couldn't agree more arel has pretty much killed the need for named scopes
|
# ? Apr 2, 2011 18:56 |
|
NotShadowStar posted:Nope, and actually you shouldn't be using scopes anyway. I think that post is based on some allergy to the same-line lambda syntax. That they're still in 3.1, not throwing a deprecation warning, shorter, easier to read, and easier to test is a good indicator that they're still a best practice. The lambda-vs-method-call thing is a bit of a red herring; the block isn't run for every record in the set, it's run once to build the association. I'd rather lose microbenchmarks and have declarative scopes than the reverse.
|
# ? Apr 2, 2011 19:52 |
|
I have some routing weirdness going on with my 2-page site. I'm not sure if it's my routes or my controller that is causing the problem. Here is my controller action: code:
code:
http://mysite.com/messages. And, that doesn't even go anywhere. What's causing that address to pop in there? I'm assuming it's REST, but I don't know how to avoid that and keep the benefits that REST is providing (simplicity). If validation fails, is there a way to say render the new action as the root URL? If I use 'redirect_to :root' instead of 'render', I'm not able pull the validation errors into the page.
|
# ? Apr 4, 2011 01:48 |
|
code:
code:
|
# ? Apr 4, 2011 02:00 |
|
NotShadowStar posted:
I'll try this right now and will report back. Thanks! EDIT: I ended up leaving the route in there with ":only" but went on to add a route to match the RESTful aberrant route generated by my call to 'render' after a validation fails: match '/messages' => 'messages#new' I don't mind this workaround and it keeps my app from breaking. Here's the site by the way: http://www.3dstxt.com It's basically a messaging site crossed with bit.ly. It's made for users of the Nintendo 3DS, which only supports 16 character messaging. It's one of my first Rails projects. Thanks for your help! plasticbugs fucked around with this message at 08:53 on Apr 4, 2011 |
# ? Apr 4, 2011 02:09 |
.
|
|
# ? Apr 4, 2011 20:27 |
|
I'm trying to convert a number to 'English language' and then pluralize it. I've been Googling/StackOverflowing for the whole day but can't find a solid answer, one that I understand or one that isn't archaic. At the moment I have 'linguistics' in my gemfile but I can't work out what to do next. I think I might need to create a helper method but that's as far as I can get. Any ideas? My code in show.html.haml is code:
I'm new to this, sorry if it's a silly question. Zurich fucked around with this message at 15:02 on Apr 5, 2011 |
# ? Apr 5, 2011 15:00 |
|
Zurich posted:linguistics According to this Readme you need to add the language you want this additional functionality to be in somewhere with the linguistics module's `use' method, and that'll give Ruby's core classes access to all of the methods provided by the linguistics module (this looks pretty cool by the way) So if you put the following in your application_helper.rb (could probably go somewhere else) for instance: code:
code:
|
# ? Apr 5, 2011 15:54 |
|
smug forum rear end in a top hat posted:According to this Readme you need to add the language you want this additional functionality to be in somewhere with the linguistics module's `use' method, and that'll give Ruby's core classes access to all of the methods provided by the linguistics module (this looks pretty cool by the way) Had to add add code:
Anyway, it's sort of working - pluralize is saying 'one tasks' at the moment, think I might just ditch pluralize and do another if rule to get the suffix right? Thanks
|
# ? Apr 5, 2011 16:18 |
|
The first Rails site that I've ever put into production is now live at 3dstxt.com. However, my question may not be Rails specific. Is there an easy Rails Way to prevent Google from indexing certain pages? I'd rather Google didn't crawl my app's "show" pages, where users are posting semi-personal content (email addresses, 3DS Friend Codes, etc). EDIT for clarity: Because of how the URLs are created, this includes any URL that matches 3dstxt.com/XXXXX I still would like Google to index the root at 3dstxt.com/ and possibly blog pages or help pages that may eventually exist. Is robots.txt the only option? plasticbugs fucked around with this message at 20:47 on Apr 6, 2011 |
# ? Apr 6, 2011 20:38 |
|
robots.txt in the public directory would be your best bet. Easy, simple, and all the search engines worth a drat respect the directives in it. By the way, if you did the project as a way to learn Rails, great, but if you wanted something simpler but like the Ruby language Sinatra would likely have been a better fit for a one controller application. NotShadowStar fucked around with this message at 23:23 on Apr 6, 2011 |
# ? Apr 6, 2011 23:20 |
|
NotShadowStar posted:robots.txt in the public directory would be your best bet. Easy, simple, and all the search engines worth a drat respect the directives in it. I uploaded a robots.txt just now. Thanks for the help! I started seeing some people sharing their email addresses and Nintendo Friend Codes, and I didn't want Google indexing that stuff. It'd be nice to have some extra free search traffic, but not at the expense of someone's privacy. Hopefully Google will still index my site's root. As for Sinatra, I considered it - I had built a simple Twitter app using Sinatra and an online tutorial. However, I'm still wrapping my head around VERY basic concepts and tools - git, sessions, routes - so I stuck with Rails.
|
# ? Apr 7, 2011 06:01 |
|
You can use the Google Webmaster Tools to see how Google is indexing your site, but this is beyond the Rails discussion and belongs in the general web questions thread.
|
# ? Apr 7, 2011 14:02 |
|
Has anyone played with Torquebox? I was quite happy being long out of the Java world, but I've been reading up on its features and getting messaging/clustering/services through JBoss actually sounds pretty loving tempting. (If it's stable, that is.)
|
# ? Apr 7, 2011 15:53 |
|
plasticbugs posted:The first Rails site that I've ever put into production is now live at 3dstxt.com. However, my question may not be Rails specific.
|
# ? Apr 7, 2011 21:48 |
|
Cock Democracy posted:If you don't want google to index these pages, consider whether you really want unauthenticated users to see these pages at all. These pages are intended to be viewed by total strangers (other Nintendo 3DS owners) who receive a URL that's being broadcasted from the user's Nintendo 3DS. So I can't restrict pages based on authentication.
|
# ? Apr 8, 2011 20:33 |
|
plasticbugs posted:These pages are intended to be viewed by total strangers (other Nintendo 3DS owners) who receive a URL that's being broadcasted from the user's Nintendo 3DS. So I can't restrict pages based on authentication. Quick google search Using meta tags to block access to your site
|
# ? Apr 9, 2011 12:23 |
|
Is anyone using Pow? http://pow.cx/ With Pow, there are no preference panes to install. No Apache configuration files to update. And Pow eliminates the need to edit /etc/hosts. To get a Rack app running, just type a single command. Looks like it's Rails 3 only, though.
|
# ? Apr 11, 2011 15:24 |
|
pow looked drat cool but I'm only really testing one app at a time right now so I'm still on webrick
|
# ? Apr 11, 2011 15:42 |
|
Im trying to truncate my blog posts (in the index view anyway) so that users have to click on the blog post to see the full post but truncate doesn't seem to play well with html_safe. Truncate will show images Ive inserted into posts (via tiny mce) but when I have a lot of text it leaves on the first <p> tag which is odd.
|
# ? Apr 11, 2011 16:49 |
|
Bob Morales posted:Is anyone using Pow? I still don't understand what the point of this is. The only use-case that I see is 37s has cross-app dependencies, so that makes it easy. Most people don't have this, so the Passenger Preference Pane is just fine. It mostly just seems like 'hey I can write a Rack adapter in node.js!' NotShadowStar fucked around with this message at 19:45 on Apr 11, 2011 |
# ? Apr 11, 2011 17:30 |
|
NotShadowStar posted:I still don't understand what the point of this is. The only use-case that I see is 37s has cross-app dependencies, so that makes it easy. Most people don't have this, so the Passenger Preference Pane is just fine. I think it's just that making a symlink is less work than firing up the prefpane, waiting for it to restart in 32-bit mode, typing a password, and dragging a folder in.
|
# ? Apr 12, 2011 13:43 |
|
That's some serious first world problem. Also 'rails server' is also just fine for development.
|
# ? Apr 12, 2011 16:06 |
|
NotShadowStar posted:That's some serious first world problem. Every problem in software and computing is a first world problem, and "just fine" isn't when "fantastic" is available and free.
|
# ? Apr 12, 2011 16:54 |
|
Anyone work with plupload and Rails before? When it uploads, rails is throwing an ActionView::MissingTemplate because the :formats is a crazy "text/*" not :html, :js, etc like I have normally seen. I cannot figure out how to make Rails 3 render a template for a specific format instead of always trying to hunt for this crazy one. When I try something like: code:
|
# ? Apr 13, 2011 15:55 |
|
|
# ? May 14, 2024 20:25 |
|
You're trying to solve the problem on the wrong end. You should poke around plupload to see how to get it to not do crazy MIME types.
|
# ? Apr 13, 2011 16:19 |