|
savetheclocktower posted:You couldn't unselect ScITE? That's the only unnecessary thing it installs, if I recall correctly, and you can opt out of it. Oh, I guess that is all it is. Thanks!
|
# ? Dec 10, 2007 03:05 |
|
|
# ? May 14, 2024 04:35 |
|
I need to do a left join on a table in an AR query to select either joined rows that are NULL (where the association did not exist) or where there is a certain value (in the case that the association did exist).code:
This means that each Event coming out of this query either has a null id or the id of its associated Vote. I suspect that it's a problem with the result set coming back from MySQL. The column names for the Event id and the Vote id are the exact same name: id. Any ideas? note: I am using will_paginate, and I tried this query using the straight up AR find(:all, ....) with the same results. EDIT 2: Hooray! :select => "events.*" seemed to do the trick. Hop Pocket fucked around with this message at 22:58 on Dec 10, 2007 |
# ? Dec 10, 2007 22:33 |
|
Hop Pocket posted:Any ideas? code:
|
# ? Dec 10, 2007 23:00 |
|
Soooo...how many other people are really unhappy with the complete lack of documentation/guidance with 2.0? basically all of my books have become obsolete, so, yeah, kinda pissed.
|
# ? Dec 15, 2007 18:22 |
|
asveepay posted:Soooo...how many other people are really unhappy with the complete lack of documentation/guidance with 2.0? But I believe that people who are just trying to learn Rails now are probably suffering from the problems you mentioned. For whatever reason, the whole community Rails once had that would help in this area seemed to die out around the 1.1 release. But I guess as a community project, anyone can step in and provide what is missing if they feel it's a problem.
|
# ? Dec 15, 2007 19:56 |
|
Are there any guides for moving an application from 1.2 to 2.0 yet? I know there's a script that does some basic compatibility checking.
|
# ? Dec 15, 2007 20:43 |
|
skidooer posted:stuff Thanks, skidooer, those links will come in handy. I'm not really just learning rails but I'm still at a beginner stage. I had completed a lot of work on an application and then 2.0 released just as I realized I had to rewrite a significant chunk of my app. So I thought it would be good to just start over using 2 and then reimport code where I could. However since I never used any of the plugins that have been folded into the 2.0 core it's a bit confusing having to cobble together information from the various mailing list postings. for instance, i had no idea .rhtml files had gotten the .erb extension till I saw some screencasts using this convention. also the model_path convention and <%=h blah %> was not one I had seen before either. Right now i'm basically forced to build portions using scaffold and then modifying that, which is not easy, especially sinc the API documents seems to also be not yet updated. asveepay fucked around with this message at 13:09 on Dec 16, 2007 |
# ? Dec 16, 2007 12:51 |
|
skidooer posted:But I believe that people who are just trying to learn Rails now are probably suffering from the problems you mentioned. Hello! Truth be told I sort of learnt the basics a year ago, but have promptly forgotten everything. I'm managing, but I'm sure I'm not doing stuff the 'Rails 2.0' way. Anyhow, I have run into a small problem: I'm making a site, with lots of static pages and then a couple of ruby pages for management and registration. How do I integrate the two? I don't want to have to make separate views for every single page (or dynamically generate them on every view with link_to's), but I can't just put in static pages and link to them normally, because then if I do relative links depending on which controller/method I am in they wil be invalid. I can't do absolute links either, because that would presume that they are on the server root (.com/xxx) which is not guaranteed, and probably not the case.
|
# ? Dec 16, 2007 15:00 |
|
asveepay posted:I had completed a lot of work on an application and then 2.0 released just as I realized I had to rewrite a significant chunk of my app. If you have a moment could you expand on what is the cause of the rewrite. I've got a project sitting at 1.2.6, but was hoping to seamlessly upgrade to 2.0, I didn't realise there were any changes that would cause a re-write of a section.
|
# ? Dec 16, 2007 15:04 |
|
Xgkkp posted:Anyhow, I have run into a small problem: I'm making a site, with lots of static pages and then a couple of ruby pages for management and registration. How do I integrate the two? I don't want to have to make separate views for every single page (or dynamically generate them on every view with link_to's), but I can't just put in static pages and link to them normally, because then if I do relative links depending on which controller/method I am in they wil be invalid. Can you just put it in the /public/ directory, I haven't found what I'm looking for yet, but there's probably a way of getting the application root directory (as a foundation for making your links) out of a config variable(that you may have to set manually).
|
# ? Dec 16, 2007 15:12 |
|
This might be more of a scriptaculous question, but I can't seem to get my animations that my RJS template return to execute serially. In other words, they seem to always run at the same time. Is there a way to get any visual_effect to run only after the previous one has finished?
|
# ? Dec 16, 2007 15:20 |
|
Hop Pocket posted:This might be more of a scriptaculous question, but I can't seem to get my animations that my RJS template return to execute serially. In other words, they seem to always run at the same time. Is there a way to get any visual_effect to run only after the previous one has finished? This is something that has begun to annoy me lately. My game uses a lot of scriptaculous and the best way I found to do things serially is to use the page.delay(seconds) command that uses a block. code:
If you're coding in pure javascript, Scriptaculous allows you to execute events once the animation has finished, however there is no API for doing this in RJS.
|
# ? Dec 16, 2007 16:43 |
|
Al Azif posted:Are there any guides for moving an application from 1.2 to 2.0 yet?
|
# ? Dec 16, 2007 17:51 |
|
Hammertime posted:If you have a moment could you expand on what is the cause of the rewrite. I'm not rewriting because of 2.0 (not really, anyway) but I started trying to integrate a feature much too late and I couldn't figure out an efficient way to insert it without breaking everything and having to debug. So i thought I'd start over and hopefully be able to use the upgraded parts of 2.0 for a more efficient/bleeding-edge app. I can't think of any portion of my 1.2.6 application which doesn't still work fine aside from a few deprecation warnings, but definitely trying to do things the 1.2.6 way is not flying too high in 2.0 land.
|
# ? Dec 16, 2007 18:15 |
|
Hop Pocket posted:This might be more of a scriptaculous question, but I can't seem to get my animations that my RJS template return to execute serially. In other words, they seem to always run at the same time. Is there a way to get any visual_effect to run only after the previous one has finished? Grob posted:If you're coding in pure javascript, Scriptaculous allows you to execute events once the animation has finished, however there is no API for doing this in RJS. http://wiki.script.aculo.us/scriptaculous/show/EffectQueues You can use EffectQueues to get that behaviour, they can sometimes behave strangely but it's likely what you want.
|
# ? Dec 16, 2007 19:01 |
|
ikari posted:http://wiki.script.aculo.us/scriptaculous/show/EffectQueues Interesting, I didn't know effect queues were supported by RJS! Having said that it wouldn't solve the problem I had above as updating an element isn't an animation, but it would solve the initial question
|
# ? Dec 16, 2007 19:43 |
|
Grob posted:Interesting, I didn't know effect queues were supported by RJS! http://wiki.script.aculo.us/scriptaculous/show/EffectsTreasureChest Check the Effect.QueueThis section, it may be what you're looking for. I haven't used it myself but it looks like it'll let you queue up an arbitrary function.
|
# ? Dec 16, 2007 20:01 |
|
Grob posted:Interesting, I didn't know effect queues were supported by RJS! Effect.Event is a skeleton effect that allows arbitrary functions to be treated as effects for the purpose of queueing.
|
# ? Dec 16, 2007 20:13 |
|
savetheclocktower posted:Effect.Event is a skeleton effect that allows arbitrary functions to be treated as effects for the purpose of queueing. Yes, but I was talking about RJS. It's not hard to trigger an arbitrary function call for a visual effect when writing your own Javascript, the issue is doing it from RJS. For example, you can say: code:
code:
My goal is to avoid writing external javascript files for simple things like fades and updates I've found this technique, which involves using the << operator to write your own first-class functions, but it seems a bit of a hack.
|
# ? Dec 17, 2007 00:36 |
|
Grob posted:And I was saying I'm not aware of a way to do: code:
skidooer fucked around with this message at 04:53 on Dec 17, 2007 |
# ? Dec 17, 2007 04:44 |
|
Grob posted:Yes, but I was talking about RJS. It's not hard to trigger an arbitrary function call for a visual effect when writing your own Javascript, the issue is doing it from RJS. I'd put all that behavior into JavaScript, then call it via RJS. code:
All the simpler RJS statements can remain that way, but this is a good way to put really hairy logic into a black box. As for this... Grob posted:My goal is to avoid writing external javascript files for simple things like fades and updates RJS isn't a leakproof abstraction. It's really just a way to place Ajax logic in your controller, where it makes sense to live. If you try to write everything in pure RJS, never touching JavaScript at all, you'll just end up uglifying your controllers.
|
# ? Dec 17, 2007 08:41 |
|
savetheclocktower posted:RJS isn't a leakproof abstraction. It's really just a way to place Ajax logic in your controller, where it makes sense to live. If you try to write everything in pure RJS, never touching JavaScript at all, you'll just end up uglifying your controllers. And slowing your application. The escape method used in updating page content through rjs (as opposed to doing a prototype Ajax Update) is pretty slow.
|
# ? Dec 17, 2007 12:07 |
|
skidooer posted:How about something like this? This is exactly the kind of thing I want (and think RJS needs). I'll take a look later and see how it works, thanks! savetheclocktower posted:RJS isn't a leakproof abstraction. It's really just a way to place Ajax logic in your controller, where it makes sense to live. If you try to write everything in pure RJS, never touching JavaScript at all, you'll just end up uglifying your controllers. Again, I'm aware you can call arbitrary Javascript from RJS. I don't want to write everything in RJS, but there are many cases where you just want to chain a couple of animations to an update. Regarding the uglyfying of your controllers, anything more than a couple of lines of RJS goes in a .rjs file in my view directory.
|
# ? Dec 17, 2007 16:16 |
|
Thanks for the help with the RJS. I used the delay / duration combo successfully. Will look more into the method chaining, but that's just a bit over my head at the moment. vvvv word, thanks. That will come in very handy Hop Pocket fucked around with this message at 04:07 on Dec 18, 2007 |
# ? Dec 17, 2007 17:11 |
|
Hop Pocket posted:Thanks for the help with the RJS. I used the delay / duration combo successfully. Will look more into the method chaining, but that's just a bit over my head at the moment. For some reason I went a whole year before noticing the very helpful empty application.js file in the javascripts directory. It's just sitting there ready to be used for things like this, I went ahead and kept creating extra js files or used inline javascript instead of capitalizing on the convenience of it. So just a tip but if you haven't noticed it already, its there.
|
# ? Dec 18, 2007 00:22 |
|
I suppose this is more of a linux question, but anyhow, I recently started running ubuntu on my laptop. Is there a way to run script/server in the background while I'm using the terminal? I'd like to be able to easily kill the process, too, but I'm not sure how to do that. Wait till you guys see my next little project -- I'm kinda proud of it. It's for a friend, and it looks spectacular.
|
# ? Dec 19, 2007 19:00 |
|
MrSaturn posted:I suppose this is more of a linux question, but anyhow, I recently started running ubuntu on my laptop. Is there a way to run script/server in the background while I'm using the terminal? I'd like to be able to easily kill the process, too, but I'm not sure how to do that. mongrel_rails start -d will start it in the background, then mongrel_rails stop will stop the server. Or mongrel_rails restart will reload it. This is of course with mongrel_rails, but that's cause its awesome.
|
# ? Dec 19, 2007 19:05 |
|
Trabisnikof posted:mongrel_rails start -d will start it in the background, then mongrel_rails stop will stop the server. Or mongrel_rails restart will reload it. This is of course with mongrel_rails, but that's cause its awesome. code:
code:
|
# ? Dec 19, 2007 19:39 |
|
While we're at it, is there a way to do that in windows, or at least to group all of my command prompt windows together (perhaps in tabs)? I run 3 rails apps on my desktop, and they can clutter up my startbar.
|
# ? Dec 19, 2007 20:14 |
|
script/server (at least mine from some random 1.2.x version of Rails) has a --daemon (-d) option
|
# ? Dec 19, 2007 22:15 |
|
So I've used capistrano/mongrel to deploy and run, as the 'agile development with rails' book suggested. Does anyone know if: a) This is the best way to deploy it b) it's worth, and possible, preventing mongrel from accepting incoming connections outside of apache (i.e. nothing but localhost - I can access it at servername:8000 publically) c) How I can easily get it to start at system boot - at the moment, the instances are started by capistrano directly, which obviously will die if the server goes down.
|
# ? Dec 19, 2007 23:16 |
|
Xgkkp posted:So I've used capistrano/mongrel to deploy and run, as the 'agile development with rails' book suggested. Does anyone know if: There are many ways to deploy a Rails app and how you want to do it has a lot to do with the hardware you have and the traffic you expect. a) I personally run a nginx web server in front of a pack of mongrels. It sounds like you're using Apache to do the same thing. I personally prefer Nginx because it's less bulky but the difference is minimal. Some benchmarks have shown that the best performance is on Apache2 with FastCGI Rails processes. b) It is possible and worth it to configure what you're talking about. I personally recommend using a firewall on all public web servers. Basically you should configure your firewall so that it only accepts incoming data on the few ports you need (usually HTTP/HTTPS/SSH/DNS and maybe SMTP). If you do this local connections (from Apache to Mongrel) will work fine, but people from the outside world will only be able to tunnel through Apache. On Linux iptables is a good place to start looking. c) Mongrel has a page about how to configure it to start on boot: http://mongrel.rubyforge.org/docs/mongrel_cluster.html - mine is set up using the points in that document and it works great.
|
# ? Dec 20, 2007 00:11 |
|
This is almost a purely apache question, but can I use mongrel and have it running on, instead of it's own subdomain (someapp.serveraddress), the site being like a subfolder serveraddress/someapp ? All the guides I have found are the former.
|
# ? Dec 20, 2007 12:01 |
|
I am just starting to get into Rails caching, and so far so good. I have some expensive things in my layouts that I want to cache using fragment caching, but would probably want to expire just those fragments as the contents of the layout code changes. Ideally I'd be able to simply wipe out these fragment caches every time I deploy my app. Is this best done using a Capistrano task? EDIT: Nevermind. I realize now that if I store my cached files in the project directory under tmp/cache, that will automatically get reset by the svn export when Capistrano deploys the app. Awesome. Hop Pocket fucked around with this message at 21:56 on Dec 20, 2007 |
# ? Dec 20, 2007 21:32 |
|
Xgkkp posted:This is almost a purely apache question, but can I use mongrel and have it running on, instead of it's own subdomain (someapp.serveraddress), the site being like a subfolder serveraddress/someapp ? All the guides I have found are the former. absolutely. Are you using mod_proxy to pass traffic back to your mongrels? Here's a config that works for apache 2.2: edit: and should work for earlier apache versions code:
|
# ? Dec 21, 2007 15:14 |
|
I use a plugin that uses the old style pagination, which has apparently been deprecated now with 2.0's release: http://api.rubyonrails.com/classes/ActionController/Pagination.html I can't seem to get classic_pagination to install using gems or the direct install command given on that page, so I want to update the plugin to use the new pagination. How do I reference pagination in it's new package? the old code looks like this code:
|
# ? Dec 22, 2007 02:21 |
|
MrSaturn posted:I use a plugin that uses the old style pagination, which has apparently been deprecated now with 2.0's release: http://api.rubyonrails.com/classes/ActionController/Pagination.html Pagination should look the same as it did before with classic_pagination, like this. code:
code:
http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/
|
# ? Dec 22, 2007 04:05 |
|
How do I install older versions of Rails? I'm just learning how to use Rails, and the book I bought doesn't cover anything about 2.0. Enough seems to be different that things aren't quite working the way I expect them to, and it's remarkably frustrating, because I remember when I had given this a shot in the past everything seemed to be fine. This is with OS X, by the way, and I've so far just been downloading the source and then compiling and installing manually with the terminal. Edit: Ah, got it. gem install rails -v 1.2.6 SpaceNinja fucked around with this message at 03:07 on Dec 23, 2007 |
# ? Dec 23, 2007 02:39 |
I'm trying to use curl to get a better feel for this REST stuff, but any action I attempt raises an InvalidAuthenticityToken exception. I imagine I need to have some kind of session ID, but I don't know how I'd generate that from curl. Any ideas?
|
|
# ? Dec 23, 2007 02:44 |
|
|
# ? May 14, 2024 04:35 |
|
MrSaturn posted:classic_pagination Instead of that, which was taken out for a reason, give this on a try will_paginate: http://errtheblog.com/posts/47-i-will-paginate http://errtheblog.com/posts/56-im-paginating-again just do piston import svn co svn://errtheblog.com/svn/plugins/will_paginate vendor/plugins and try it out. If you don't like it then go back to classic. Piston, assuming that you're keeping your stuff in a svn repo. edit: here's a screencast on it: http://railscasts.com/episodes/51 Pardot fucked around with this message at 07:49 on Dec 24, 2007 |
# ? Dec 23, 2007 08:06 |