|
cYp posted:I'm either going to get started learning PHP or Ruby on rails. I'm currently leaning towards php. Will this be a mistake in the future?
|
# ¿ Aug 24, 2007 13:39 |
|
|
# ¿ May 8, 2024 22:42 |
|
What hosts are you internet dudes using for your rails stuff?
|
# ¿ Dec 24, 2007 03:00 |
|
It's just all so expensive for something that I'm not sure will last Hop Pocket posted:I'm using Joyent. I don't have a good frame of reference, as I'm fairly new to Rails and that particular world, but I will say that I have found their support to be really helpful and responsive. Railsmachine looks to be way out of my price range right now, at any rate.
|
# ¿ Dec 24, 2007 06:11 |
|
Looks like I'll probably sign up for a year of the base Accelerator package on Wednesday, unless something better comes around -- $45 for what they offer isn't bad or anything, I just wish it had more bandwidth.
|
# ¿ Dec 24, 2007 15:35 |
|
Like ikari said, it's more of an "in theory" thing. No one in their right mind fucks around with the low level stuff, and if someone did in a widely distributed library, there would be a hell of an uproar about how stupid they are. In practice, open classes are fantastic and make so many things so simple.
|
# ¿ Dec 27, 2007 20:36 |
|
With dreamhost and fastcgi, you learn about rails optimizations really fast. I recommend everyone do it once.
|
# ¿ Jan 9, 2008 00:58 |
|
What's the migration that you're using?
dustgun fucked around with this message at 05:07 on May 1, 2008 |
# ¿ May 1, 2008 05:03 |
|
This is more of a general ruby question, but how the hell do I unpack a utf8 string in ruby 1.8 and get it so that \xC2\xAE actually shows up as ® in the output? I've never really done this stuff, and feel sort of lost googling around.
|
# ¿ May 25, 2008 21:31 |
|
DoubleDamnit post
|
# ¿ May 25, 2008 21:31 |
|
Perfect, thanks.
|
# ¿ May 26, 2008 19:48 |
|
Pardot posted:I could be wrong, but I don't think you can do that with something like shoes. I think the best you can do is do something in jruby and package that into bytecode. I haven't looked into any of this myself, but I think there is at least one jruby UI thing. This is all just vague recollections from my rss feeds, though. quote:Okay, the latest set:
|
# ¿ Jun 19, 2008 17:26 |
|
Is there a way to explicitly set the id, instead of letting it auto_increment, when creating a record with AR? I'd prefer not to do this in actual SQL, but whatever if I have to I have to.
|
# ¿ Jul 11, 2008 02:52 |
|
Mr. Wynand posted:I don't know of hand, but are you absolutely sure you have to? Crap, that's a horrible explaination. Eitherway, it's something I started doing and then sort of wondered if you could do it with AR
|
# ¿ Jul 11, 2008 04:40 |
|
Hopefully this sort of maybe helps.code:
dustgun fucked around with this message at 23:24 on Jul 22, 2008 |
# ¿ Jul 22, 2008 22:57 |
|
http://www.geonames.org/ is a good source of data for such things
|
# ¿ Oct 21, 2008 03:12 |
|
Rails programmers, I have a question: I have 2 tables, let's say Node(number: integer, owner: string) and Link(up: integer, down: integer) where up and down are foreign keys to Node's number. I really, really want to be able to go Node.find(x).up_nodes and get a list of Nodes back. Getting the Links back is obviously easy enough, but I can't figure out the right incantation for has_many :through and whatnot to get back a list of the Nodes themselves. Self-referential queries with non-standard keynames have defeated me
|
# ¿ Nov 7, 2008 05:23 |
|
skidooer posted:If I understand your problem correctly, you are looking for something like this:
|
# ¿ Nov 7, 2008 14:09 |
|
edit: nevermind
dustgun fucked around with this message at 15:24 on Dec 10, 2008 |
# ¿ Dec 10, 2008 06:36 |
|
Route generation question time: url_for, through polymorphic_url, can take an activerecord object (or group of them) and turn it into a route. Like url_for(Post.first) -> /post/1 by calling post_url which is a named route function generated by saying that Post is a resource. Or something. I don't use resources so I'm just guessing on that bit, but I do know the route generated would be something like map.post('/post/:id', :controller => 'post') and then some magic happens when Post.first is passed in :id gets matched with the route parameter. Before I really dig into routing's code, what I want to know is if there's a way to use named routes, url_for and AR records in a way that works without needing the :id parameter. Like if I have... code:
is there a way to do url_for(Person.first) -> /person/schmoe/joe without having to explicitly say url_for(person, :first_name => person.first_name, :last_name => person.last_name)? It figures out that it needs to call person_url, but it doesn't dig into the model to see if last_name and first_name are able to be dropped into the route. Instead, it tries to positionally assign the arguments to url_for on top of the route parameters, so you end up with :last_name => #<User id: 1, fullname: "joe schmoe">, :first_name => nil. Does what I'm asking make sense? Am I totally misunderstanding something?
|
# ¿ Dec 15, 2008 17:05 |
|
Oops, I should have mentioned I knew about to_param. Given url_for(User.first) in a view: I could use to_param to make it a little prettier: /person/:id as a route, giving me /person/joe-schmoe. What I want is /person/:last_name/:first_name as a route, giving me person/schmoe/joe. Doing that requires url_for et al to look at the object I passed in beyond just taking the result from a to_param call. I guess the polymorphic url helper wasn't really meant to be used like this, but it sort of surprised me it didn't do this :-\
|
# ¿ Dec 15, 2008 19:51 |
|
Praetorian42 posted:Any particular reason you want it to be person/schmoe/joe? Purely aesthetics? Going down this path seems like bad news to me. Here's the more practical one: I have a table full of CIDRs, represented by 2 integers - start_ip and end_ip. Having a route like /cidr/1 is dumb, as is /cidr/22605312/22605567 - I want cidr/1.88.238.0/24. It's easy enough to do as long as I use cidr_path(), but I really really want url_for to do this automagically because there are a bunch of cases where I get a list of objects back from something - say, search results - and they can be all different kinds of data. Country Names, Corporations, CIDR owners, Domain Names, etc. Right now the only way to iterate over those results and use the correct _path() method would be to do something like skidooer suggests. I mean, that wouldn't be the worst thing in the world. It just feels like the current polymorphic routing is tantalizingly close to what I want
|
# ¿ Dec 15, 2008 22:03 |
|
quote:(I know this isn't what you're really looking for, but I'm a sucker for shortcuts.) I'll probably spend tonight figuring out how messy of a patch this would be, just for kicks.
|
# ¿ Dec 15, 2008 22:43 |
|
No, you aren't that far off, and right now I have a method in my application helper that hides of the messiness, but I still don't like it. This was all sparked by me having url_for(@cidr) in a template and being surprised at getting :ip => #<Cidr id: 1, start_ip_address: 0, end_ip_address: 255> as part of the exception from cidr_url. It just seemed like I must have been doing something wrong, because it was getting the cidr_url call right, but then not matching up the route requirements with what attributes & methods @cidr had. Incidentally, it only took me a few minutes to come up with a dirty, 3 line patch that handles this and passes all existing rails tests. Ok now go talk about something else!
|
# ¿ Dec 16, 2008 00:11 |
|
I was just about to start playing with merb today but now it feels horribly moot
|
# ¿ Dec 23, 2008 21:29 |
|
Praetorian42 posted:It might actually benefit to start learning Merb. It'll get you prepared for Rails 3, which, after reading more, might be very heavily impacted by the Merb merge. quote:Overall, this seems like it is great for Rails people and "Meh?" for Merb people. I haven't seen a Merb person (aside from the Core team) who is particularly excited about this.
|
# ¿ Dec 24, 2008 00:02 |
|
erp, nevermind.
dustgun fucked around with this message at 01:28 on Jan 24, 2009 |
# ¿ Jan 24, 2009 00:25 |
|
Anveo posted:Also, I have a legacy table for related products. All it has is a left_id and a right_id. What is the best way to accomplish this in rails? I looked into nested_set and acts_as_tree stuff, but that seems like it might be a bit much for this. I could do a normal join model, but I guess what is throwing me off is both columns will be pointing to the same class (Product). I had an issue that might be similar - I honestly can't quite tell for sure - that was answered in this thread a while ago. http://forums.somethingawful.com/showthread.php?threadid=2585949&pagenumber=20&perpage=40#post351829056
|
# ¿ Apr 5, 2009 17:32 |
|
http://guides.rubyonrails.org/getting_started.html is what I'd recommend at this point. If you need something more realtime than a forum for help, jump into IRC and ask if anyone can help you with sticking points.
|
# ¿ Apr 24, 2009 00:41 |
|
Actually, wait. Running scripts and RoR don't go together very well at all because that's not what RoR is really for. What exactly does he want you to do, and are you sure he wasn't just asking you to do it in Ruby?
|
# ¿ Apr 24, 2009 03:07 |
|
What do you need to tackle? Installing ruby? Installing the gems? Using the script? Maybe if you take this to the general questions thread you'd have more luck.
|
# ¿ Apr 27, 2009 23:39 |
|
Yeah.. whatever you're trying to do, you're doing it wrong.
|
# ¿ Jun 9, 2009 22:50 |
|
I'm interested in playing with engines right now, but haven't been able to find any decent guides. Namely I'm looking for someplace that talks about how all the precedence works for adding routes and overriding controller actions.
dustgun fucked around with this message at 02:03 on Jun 24, 2009 |
# ¿ Jun 24, 2009 01:30 |
|
That's more suited for the general programming questions thread, buuuuut:code:
code:
Anyway. RailsChat time! I think bc2c4a45959be21e6314fba7876b32c1f04cd08a, a commit from the 2.3 branch that hasn't been merged into the 3.0pre branch yet, has badly broken something with cache_classes=false running on mongrel. I spent a nice chunk of my day tracking it down and am just about to sit down and try and write a test case for it. Somehow. Bleh.
|
# ¿ Jul 24, 2009 01:50 |
|
Oh duh, I spaced out and forgot about the initial point. Sorry dude.
|
# ¿ Jul 24, 2009 02:05 |
|
I did use git-bisect for it (and it was super neat). I had thought it was a problem we hadn't caught with our code, so I didn't bother checking rails until late in the day. Oops.
dustgun fucked around with this message at 15:24 on Jul 24, 2009 |
# ¿ Jul 24, 2009 15:21 |
|
I used to be that way, but after a few years I feel like I can reliably install things on linux edit: sometimes. dustgun fucked around with this message at 23:39 on Aug 18, 2009 |
# ¿ Aug 18, 2009 23:36 |
|
Assuming you don't want it in the db as anything other than a cache, you'll probably want fragment caching. I haven't used it, but I believe the usage is just code:
code:
in your config
|
# ¿ Aug 19, 2009 02:10 |
|
Myrddin Emrys posted:This last line is the part that fails, saying:
|
# ¿ Aug 19, 2009 03:28 |
|
what does code:
Regardless of if multiple ruby binaries show up for some retarded reason (which is my lame guess atm), I'd be happy to dick around in an irc room or on AIM and get you up and running. I like playing around with new frameworks, but I loathe getting them setup because of crap like this. dustgun fucked around with this message at 04:24 on Aug 19, 2009 |
# ¿ Aug 19, 2009 04:18 |
|
|
# ¿ May 8, 2024 22:42 |
|
Hooray. I felt horrible last night when I realized I'd totally spaced out and forgotten about my offer to help out on AIM.
|
# ¿ Aug 20, 2009 14:48 |