|
wunderbread384 posted:Edit: Also, is the method private maybe? I would imagine Rails should throw an error if that happens but many things in Rails don't happen the way I imagine. Nope, it's public, but that got me fooling around a little more. On a whim, I renamed my "display" action to "enlarge", updated the routes and all the other references, and it works now! What I didn't realize at the time is that Ruby already has an Object#display method, which I would have to guess is what caused the problem. A lot of trouble for nothing, apparently.
|
# ? Dec 20, 2008 01:38 |
|
|
# ? May 15, 2024 17:27 |
|
The TinyMCE ~/vendor/plugin folder seems to come with basically the same folders it puts in the ~/public directory. Is it safe to delete anything out of there? It slows down and usually times out FTP and SVN transfers.
|
# ? Dec 20, 2008 03:02 |
|
Flobbster posted:I'll rename it "enlarge", so we stop getting hung up on the synonym and overlooking the actually problem here, which is why an action method isn't getting called. You know what, that would fix it. "display" is a preexisting method in ActionController. Edit: Oh, there was a new page I didn't see and you found that out already. Awesome.
|
# ? Dec 20, 2008 06:17 |
|
Having a weird problem with drag & drop sortable lists-- I have two lists, one of categories and one of pages, with the following code: code:
BUT when I drag and drop my pages around, the UI changes, but the DB is not updated. This happens in my development.log: code:
code:
As you can see, the UPDATE command is missing for the pages section, and it's instead doing some weird select where clause that says id <> 6 or 7 depending on the id phazer fucked around with this message at 02:08 on Dec 21, 2008 |
# ? Dec 20, 2008 18:35 |
|
phazer posted:How do I put links in a boolean output? Can I? There must be a way. I prefer to do code:
|
# ? Dec 21, 2008 02:02 |
|
Praetorian42 posted:I prefer to do I ended up going with this (I got some help on the IRC channel): code:
|
# ? Dec 21, 2008 02:07 |
|
I have an Entries model and I have a Votes model. Each Entry has many Votes and each time that an Entry is loaded, the associated Votes will also need to be loaded, is there a way I can use scope to automatically :include => :votes on each request? Or is this not good practice?
|
# ? Dec 21, 2008 15:13 |
|
Nolgthorn posted:I have an Entries model and I have a Votes model. Each Entry has many Votes and each time that an Entry is loaded, the associated Votes will also need to be loaded, is there a way I can use scope to automatically :include => :votes on each request? In Edge rails, there's now default scoping: http://ryandaigle.com/articles/2008/11/18/what-s-new-in-edge-rails-default-scoping Although if you aren't running Edge, you might want to just create a named_scope that does it, and just make sure you always use that named_scope when accessing your entries.
|
# ? Dec 21, 2008 20:34 |
|
Nolgthorn posted:I have an Entries model and I have a Votes model. Each Entry has many Votes and each time that an Entry is loaded, the associated Votes will also need to be loaded, is there a way I can use scope to automatically :include => :votes on each request? Honestly, it's not good practice. Evil Trout's suggestion is better though. I think it's pretty important to be able to see the eager loaded tables (or at least scopes that suggest something funny's going on) at first glance for every ActiveRecord find call. code:
code:
|
# ? Dec 21, 2008 23:08 |
|
phazer posted:I ended up going with this Edit: I think this is a little nicer to read, also. code:
skidooer fucked around with this message at 06:09 on Dec 22, 2008 |
# ? Dec 22, 2008 05:28 |
|
Thanks for the advice, I am using named_scope now. I have some restful routes in my application, shorthand it looks like this. code:
Before I started using rest Rails was good at picking the shortest url because I would always put the shorter urls lowest in the order. Or do I have to start explicitly using root_path instead? Nolgthorn fucked around with this message at 04:53 on Dec 23, 2008 |
# ? Dec 23, 2008 04:46 |
|
Nolgthorn posted:The path /entries should never really come up unless I've specified a entry_id, is there a way for me to tell Rails that the shorter url should take priority? code:
|
# ? Dec 23, 2008 04:55 |
|
That didn't really seem to fix it, my routes are a bit more verbose, let me post in more detail including your suggestion I'm still getting directed to /entries with entries_path.code:
|
# ? Dec 23, 2008 05:17 |
|
Nolgthorn posted:That didn't really seem to fix it Redefine entries outside of the resources block.
|
# ? Dec 23, 2008 05:20 |
|
True, I'm getting this error: "undefined method `entries' for main:Object" line starting with "with_options" and the one right below it. With this code: code:
|
# ? Dec 23, 2008 05:23 |
|
Nolgthorn posted:I'm getting this error: "undefined method `entries' for main:Object" line starting with "with_options" and the one right below it.
|
# ? Dec 23, 2008 05:25 |
|
Well I'll be, that works. Incredible that it does, confuses me a lot. Thanks. Edit: also I was able to cram my map.root in there too. code:
Nolgthorn fucked around with this message at 05:33 on Dec 23, 2008 |
# ? Dec 23, 2008 05:30 |
|
Augh more problems, of course. OKAY this one is a doozie to me: I've got this guy going on: code:
code:
|
# ? Dec 23, 2008 19:38 |
|
phazer posted:And when I change the select field, I get the "Hello World" alert (as a test to make sure it's working) but the div does not display. No clue.
|
# ? Dec 23, 2008 19:42 |
|
Also you don't have to write the html for labels. There is a label method provided in rails for the convenience. Just a style thing.
|
# ? Dec 23, 2008 19:58 |
|
phazer posted:No clue. Look at the Javascript that Rails is pumping out, and see what's wrong with that. I hate RJS for just this reason.
|
# ? Dec 23, 2008 20:32 |
|
So... Merb and Rails are to merge for Rails 3. Thoughts, everyone? Personally, I'm kind of pissed off. There's a reason I stopped developing in Rails and moved over to Merb. The way Rails handles rendering is enough to make me hate the thought of going back.
|
# ? Dec 23, 2008 21:24 |
|
I was just about to start playing with merb today but now it feels horribly moot
|
# ? Dec 23, 2008 21:29 |
|
Praetorian42 posted:So... Merb and Rails are to merge for Rails 3. Thoughts, everyone? Yeah we'll see how it goes. If it ends up being the best of the two, that'll be great. From what I've talked to people, Rails is going to be like Merb, where the default stack is just going to be the current Rails stack. But you could swap out AR for datamapper, or you could easily switch to jquery without extra plugins like you need today. For rails, they get some smart people on the team from merb, and don't have to worry about merb killing them. For merb, they get, what, name recognition? I don't really see how this move helps the merb team.
|
# ? Dec 23, 2008 21:48 |
|
Pardot posted:Yeah we'll see how it goes. If it ends up being the best of the two, that'll be great. I'm all in favor of choice, but since I already had that with Merb, I don't really gain anything. I'm not sure why this is good for Merb, either. I, personally, didn't see the competition between the two frameworks as a bad thing. dustgun posted:I was just about to start playing with merb today but now it feels horribly moot 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. 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 23, 2008 22:03 |
|
skidooer posted:Are you including prototype.js? Also, I have to ask, why aren't you using named routes? I am definitely including prototype, because the alert("hello world") works, and the log shows the action being called from the controller, with the correct parameters. For some reason page.show 'products' isn't working. Also, I'm still a big time noob so I'm not using named routes because I'm not even sure what you mean. I mean, I know how to look it up and figure it out, but it's going to take time, it's not what I'm used to (I started on the tutorials for 1.2) I figured it out. It can't overwrite my CSS (display:none;) So I need to hide it with prototype on load, too. No big. Now my problem is I have If conditionals powering which DIV element to show depending on what's selected. According to my log, my parameter is :entry_type_id so I would think this would work: code:
phazer fucked around with this message at 22:37 on Dec 23, 2008 |
# ? Dec 23, 2008 22:13 |
|
phazer posted:so I would think this would work: But it doesn't. code:
|
# ? Dec 23, 2008 22:40 |
|
skidooer posted:params[:entry_type_id] will be a string unless you convert it to another type. Try this instead: Awwwwwweeesome! Thanks!
|
# ? Dec 23, 2008 23:01 |
|
Praetorian42 posted:I, personally, didn't see the competition between the two frameworks as a bad thing. Competition helps in business because there is a benefit to having more customers than the next guy. There is no real benefit to having more "customers" than the other guy when your product is free, and freely available to be modified.
|
# ? Dec 23, 2008 23:33 |
|
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 |
|
I am using attachment_fu with ImageMagick/RMagick and I have this code in my photo model:code:
|
# ? Dec 25, 2008 16:33 |
|
Fairly certain that attachment_fu still doesn't support cropping due to the vast differences between the many image processors out there. You may have a modified version of the plugin that is only designed to work with some processors and may be running on a different one by default in production. Try this: code:
|
# ? Dec 26, 2008 04:13 |
|
This is by far the best article on Rails 3 Merb/Rails merge, or Why should merbists be happy?, and it's answered all of the questions I had about what was in it for merb. I'm pretty excited now. What I'd like to see most, I think, is a big step forward from each framework. Even if it will break a lot of existing stuff and plugins. Sorta like the difference between os 9 and X. If there's going to be a clean merb-style API, there could maybe be some sort of transition API on top of that to ease old apps into Rails 3, whereas new apps wouldn't need it.
|
# ? Dec 26, 2008 07:16 |
|
Pardot posted:This is by far the best article on Rails 3 Merb/Rails merge, or Why should merbists be happy?, and it's answered all of the questions I had about what was in it for merb. Why is it important to maintain any semblance of plugin backwards-compatibility? Generally if you're developing a Rails application, you use the latest version and go to production when it's done using whatever version you started with, unless there is a feature you absolutely need you wouldn't update it. I would imagine there is a lot of code that could be different or that is different in Merb, why keep all these old methods? Isn't that all the opposite of trimming down the bloat Rails has been accumulating and the opposite of making it run faster? Edit: Ohhh they're just talking about a public API for plugin functionality... ok I guess. I really hope they bring Merb's slices. Nolgthorn fucked around with this message at 11:29 on Dec 26, 2008 |
# ? Dec 26, 2008 11:16 |
|
Nolgthorn posted:Fairly certain that attachment_fu still doesn't support cropping due to the vast differences between the many image processors out there. You may have a modified version of the plugin that is only designed to work with some processors and may be running on a different one by default in production. The exact same plugin, image processor and model/code works on my other copy of the application though. Example: On my production server: On my local copy: The only difference is on my production copy I'm doing 75x75! instead of 70x70! Everything else is the same: model/code, plugin, img processor. The production copy STARTED on my local box and worked then, too.
|
# ? Dec 26, 2008 15:10 |
|
I still think you would benefit by specifying the image processor you want if you're going to be using cropping.
|
# ? Dec 26, 2008 15:17 |
|
Nolgthorn posted:I still think you would benefit by specifying the image processor you want if you're going to be using cropping. It did not help. I don't know what's up with it. Really sucks though because his thumbnails look like crap and that's no good for a photography portfolio.
|
# ? Dec 26, 2008 16:59 |
|
I have been working on a Rails contract for the past year but it's coming to an end in January and there are no other local jobs. What are you guys doing for work? Where are places to look for work online?
|
# ? Dec 26, 2008 22:47 |
|
Nolgthorn posted:Why is it important to maintain any semblance of plugin backwards-compatibility? Generally if you're developing a Rails application, you use the latest version and go to production when it's done using whatever version you started with, unless there is a feature you absolutely need you wouldn't update it. Vulture Culture fucked around with this message at 21:18 on Dec 27, 2008 |
# ? Dec 27, 2008 18:59 |
|
|
# ? May 15, 2024 17:27 |
|
phazer posted:It did not help. I don't know what's up with it. Really sucks though because his thumbnails look like crap and that's no good for a photography portfolio. UGH, I realized what it is. I looked up how to do cropped thumbnails with attachment_fu/rmagick, and I remembered I found this, which makes you rewrite the processor code: Crop Images using Attachment_Fu/rMagick
|
# ? Dec 28, 2008 08:35 |