Hii Yong, As i have given the syntax above would you tell me what is the syntax i used because i have tried so much but its not working... thanks rahul On Mar 27, 6:01 pm, Yong Gu <zerogy...@gmail.com> wrote: > Hi, > > I think you should use *error_message_on(object, method)* if you want to > show the error of one specified field, like 'title', 'description' > > and use *error_messages_for(object)* if you want to show all the validation > errors in this object > > On Sat, Mar 27, 2010 at 8:33 PM, Rahul Mehta <rahul23134...@gmail.com>wrote: > > > Hi all, > > > I'm new here. However, I'm so happy because I got Ruby on Rails to > > work on my host. Now there's just a problem with displaying > > validation error message , > > > in my view i have used the form_tag code is as follow > > > <% form_tag 'create', :multipart => true do %> > > > <%= error_messages_for :content_masters %> > > <p> > > <%= label_tag :title %> > > <%= text_field_tag :title %> > > </p> > > > content_masters is my controller name .. > > > in my model m using > > > validates_presence_of(:title, :message => "message") > > > the validation message is not coming .. > > > I hope you want to help me. > > > Thanks > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Just trying a simple example to try to get nested to work... but can't get it! Been 2 days! Please help. VERY SIMPLE controller, view, models... listed below. ----------------------ERROR MESSAGE---------------------------------------------------------------------- ActiveRecord::AssociationTypeMismatch in UserController#update_player Racquet(#38866740) expected, got Array(#20762670) ------------------------------------------------------------------------------------------------------------------------- -----------------MODELS------------------------------------- class Player < ActiveRecord::Base has_many :racquets, :dependent => :destroy accepts_nested_attributes_for :racquets end class Racquet < ActiveRecord::Base
belongs_to :player end --------------CONTROLLER----------------------------- class UserController < ApplicationController def index @player = Player.new @player.racquets.build end def update_player @player = Player.new(params[:player]) @player.save redirect_to :action => :index end
end ----------------------- VIEW ------------------------------------------- <div> <% form_for :player, :url => { :action => :update_player, :id => @player.id } do |f| %> Name: <%= f.text_field :name %> <br> Rank: <%= f.text_field :rank %> <br> <% f.fields_for :racquets do |racquets_form| %> Racquet Name: <%= racquets_form.text_field :typ %> <br> <% end %> <%= f.submit "Submit" %> <% end %> </div> -------------------------------------------------------------------------------- This was supposed to be quick practice form to make use of nested models.... and has turned into a nightmare. Can anyone tell my why it is not working??? Thanks so much, Shawn -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Back again -- On Fri, Mar 26, 2010 at 5:12 PM, Jeremy Kemper <jeremy@bitsweat.net> wrote: > Hello again, > > On Thu, Mar 25, 2010 at 7:21 PM, Jeremy Kemper <jeremy@bitsweat.net> wrote: >> Fellow Rubyists, I'm proud to announce the first annual Ruby Summer of Code. >> >> In the best tradition of Google's legendary summers of code, Ruby >> Central, Engine Yard [1], and the Rails team [2] have joined forces to >> muster a legend of our own, a new summer program for student Rubyists >> to flex their open source might. >> >> * Students are paid a $5000 stipend to work full-time during their summer break. >> * A group of Ruby gurus volunteer their time as mentors. >> * Mentors vote on student proposals based on usefulness, benefit to >> the Ruby community, and history of motivated open source contribution. >> >> Check out http://rubysoc.org for the full story, to volunteer as a >> mentor, and to sponsor a student. >> >> Student applications begin on April 4. Students, start working on your >> proposal now! Rails [3] and JRuby [4] have ideas lists up as a >> starting point. All Ruby projects are welcome. >> >> This is an entirely volunteer effort. The more we raise, the more >> students we can sponsor. 100% of contributions go directly to >> students. We already broke the $20,000 mark -- 4 summer students -- >> and we're aiming for *20* total. >> >> Do you make a living using Ruby? Does your business live and breathe >> Rails? It's a sweet and wonderful path. Donate today at >> http://rubysoc.org. >> >> Let's make this happen. >> >> Best, >> Jeremy Kemper >> >> [1] http://www.engineyard.com/blog/2010/ruby-summer-of-code-is-here/ >> [2] http://weblog.rubyonrails.org/2010/3/24/ruby-summer-of-code >> [3] http://wiki.rubyonrails.org/rubysoc/2010/ideas >> [4] http://wiki.jruby.org/RubySummerOfCode2010 > > UPDATE > > Great news: we broke the $75,000 mark in less than 24 hours! We've > raised enough to fully fund 15 summer students. > > We're so grateful to see the Ruby community coming out to support this > program in its first go around. Great expectations. > > So with stars in our eyes and we're setting a cap at 20 students. Just > $25K to go. Take us the last mile. DONE! We've raised $100,000 to sponsor 20 summer students. Wow, just wow. Best, Jeremy Kemper -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
HugoLnx wrote: > im aren't expert in nothing, but I think the inline does not work in > most current versions of browsers. > Sorry about my bad english.xD Where did you get that idea? I don't know of any modern web browser that doesn't support all the CSS in style="margin:0;padding:0;display:inline" The only thing I can think of that might be getting you confused is that some browsers (okay really only the stupid one that needs no introduction) would be "display: inline-block;" All modern browsers AFAIK support "display: inline;" -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
horrah! thanks so much, it was the @post = current_user.posts.build(params[:post]) that i was stuck on And now, i get it. and now it works. ur a life saver, thanks so much !!!! On Mar 27, 10:26 am, Lasse Bunk <lasseb...@gmail.com> wrote: > Hey David, > > It's really pretty easy and straightforward. > In your PostsController: > > def create > @post = current_user.posts.build(params[:post]) > if @post.save > # ... > else > # ... > end > end > > Also in your PostsController, to list posts only from current_user: > > def index > @posts = current_user.posts > end > > If you want your show method to only look for posts from current_user: > > def show > @post = current_user.posts.find(params[:id]) > end > > /Lasse > > 2010/3/27 David Zhu <dzwestwindso...@gmail.com> > > > Hey, > > > I made my authentication system using Authlogic, and I have a > > current_user helper > > > Now, I also made a scaffold called posts, and everytime a user creates > > a post using that scaffold, i want it to be assigned to that > > particular user. > > > So i can render out the posts that ONLY that user made. > > > Now, the question is what to do in the forms, and what to do in the > > posts controller. > > > Right now, I already have a has_many belongs_to relationship between > > the too, but i dont know where to go next. What do i have to chnage in > > the posts controller? What is my post form supposed to look like in > > order for it to be associated with the current_user? > > > AWww ive been trying to get my mind around this, but i can't. i need > > help. really bad. > > > Someone please help. please!! > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On Wed, Mar 24, 2010 at 9:37 PM, mcculloughsean < mcculloughsean@gmail.com> wrote: > Hey Everybody! > > I've just been tasked with maintaining a very old, poorly written > ecommerce website and am pondering Spree as a solution as a basis for > a fresh start. I have a couple of issues to raise to the community > that will help me determine if spree is the appropriate solution for > us. > > First: RoR has been the only platform on which building this solution > would make sense to me. While i've been out of the scene for a while, > I took the time to see what was going on with the whole ecosystem. > Ruby on Rails 3 is due to become final anytime now and offers a bunch > of new features which are worth adopting from the outset. Reading the > discussions here has left me without any good idea about how the Spree > community will address the changes RoR3 will bring, and when to expect > a new release. So what should I expect regarding Spree's development > and Ruby on Rails 3? > > Second: Our business is centered around a very complex and archaic > home grown system. I'm looking to export the data to the site, use > some sort of API to keep the two systems in sync (even better if it > was real time), and then export orders to our system. Has anyone > developed a solution similar to this in the past? While i realize the > implementation would be unique to my own situation, any pointers, > references to good plugins, or cautionary tales would be greatly > appreciated. > > Third: HAML looks pretty sweet. I feel like it will become a huge time- > saver to use this instead of ERB. Does anyone have experience using > this with Spree? Or is there any intention of integrating it with > Spree? > here's the default theme hamlized: http://github.com/bendyworks/theme-default-haml-- You received this message because you are subscribed to the Google Groups "Spree" group. To post to this group, send email to spree-user@googlegroups.com. To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…
Lasse Bunk wrote: > I'm bouncing a little back'n'forth here. After reviewing the jQuery > noConflict() code it doesn't matter if you load jQuery before or after > Prototype. > > However, you need to switch on your javascript debugging tools so we can > get > some error messages – do you have Firebug or something like it? > > /Lasse > > 2010/3/27 Chris Kalaboukis < lists@ruby-forum.com> ah ha...I'm getting this error: jQuery is not defined [Break on this error] jQuery.extend(String.prototype, { in application.js line 29 jQuery.extend(String.prototype, { 30 databaseId: function() { return $.trim(this.split('_').last()); } 31}); Well i think aha....whats doing that? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
im also new to rails if u have good materials to learn rails please tell me send me links thanks... On Mar 27, 5:33 am, Rahul Mehta <rahul23134...@gmail.com> wrote: > Hi all, > > I'm new here. However, I'm so happy because I got Ruby on Rails to > work on my host. Now there's just a problem with displaying > validation error message , > > in my view i have used the form_tag code is as follow > > <% form_tag 'create', :multipart => true do %> > > <%= error_messages_for :content_masters %> > <p> > <%= label_tag :title %> > <%= text_field_tag :title %> > </p> > > content_masters is my controller name .. > > in my model m using > > validates_presence_of(:title, :message => "message") > > the validation message is not coming .. > > I hope you want to help me. > > Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Whoops, Comment.create(model) should of course be Comment.create(comment) And you should be able to replace it with Comment.create(params[:comment]) /Lasse 2010/3/27 Lasse Bunk <lassebunk@gmail.com> Hi Szimek,
You can do it like this:
# hash to simulate what comes from your params[:comment] comment = { :text => "Comment text", :venues_attributes => [{ :name => "one" }, { :name => "two" }] } # you set the user id by calling a block on create Comment.create(model) { |c| c.venues.each { |v| v.user_id = 1 } }
Hope this helps.
/Lasse
2010/3/26 szimek <szimek@gmail.com> Hi, I've got 3 models: Comment, Venue and User. Comment has many :venues and belongs to :user. Venue belongs to :user as well. When adding a comment, user should be able to attach a venue to it. In Venue model "user_id" attribute is protected and it is required as well - this causes problem when trying to create a venue when adding a comment using nested attributes, because I can't pass "user_id" attribute required by venue - it's protected and thus rejected. Any ideas how to solve it? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi Szimek, You can do it like this: # hash to simulate what comes from your params[:comment] comment = { :text => "Comment text", :venues_attributes => [{ :name => "one" }, { :name => "two" }] } # you set the user id by calling a block on create Comment.create(model) { |c| c.venues.each { |v| v.user_id = 1 } } Hope this helps. /Lasse 2010/3/26 szimek <szimek@gmail.com> Hi, I've got 3 models: Comment, Venue and User. Comment has many :venues and belongs to :user. Venue belongs to :user as well. When adding a comment, user should be able to attach a venue to it. In Venue model "user_id" attribute is protected and it is required as well - this causes problem when trying to create a venue when adding a comment using nested attributes, because I can't pass "user_id" attribute required by venue - it's protected and thus rejected. Any ideas how to solve it? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On 27 March 2010 18:13, Erik Lindblad < erik@aldm.se> wrote: > Excellent, you are right. I thought I tried that but I have tried many > combinations so I must have done it for something that was not > persistent in itself. @@variable worked when in production mode. You > made me a very happy camper. As a matter of interest how are you deciding when to release the connection? Also don't forget that if you ever went to multiple servers to serve your app that successive requests from a user may not go to the same server. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
I agree that it looks like Rails 3 and Engines make a lot of our previous extension hackery unnecessary. I suspect there are a few small things still missing that we'd like to patch in. One example might be migrations. They don't automatically load plugin/engine migrations with rake db:migrate in Rails 3 (nor do they plan to.) Perhaps this is not a desirable feature but I'm thinking we could work together to come up with a list to identify the following: 1. What is required for robust extension system 2. What is provided by Rails 3 and how do we leverage that functionality (and document it.) 3. What is missing in Rails 3 still 4. Standard way to implement missing functionality for Spree and Radiant We don't have the admin hooks you're using in Radiant but we do have themes implemented already. We use themes as extensions actually and I think it would be very cool to have the two systems use the same theme approach (but not necessary.) I think items 1-3 would be useful joint exercise. Comprehensive documentation on all of this is spotty and I think both camps have a pretty good idea of the kinds of things we'd need to support. I certainly wouldn't mind working with a few people to quickly test out what is possible now in Rails 3. Sean Schofield -- Radiant CMS Dev Mailing List Post: radiantcms-dev@googlegroups.com Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com Group Site: http://groups.google.com/group/radiantcms-dev/ To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Read More…
On Sat, Mar 27, 2010 at 19:20, Benny Degezelle <benny@gorilla-webdesign.be> wrote: This will change the behavior of pages with the ArchivePage class, so that, when you expand them in the backend, you get a list of years and under those months, that on their turn expand with the pages posted in their timelapse (am i making sense?). So, instead of getting a very long list of possibly thousands of pages, you drill down to a certain month and only get the pages posted in that month.
That sounds very useful. Together with a feature to search by title (sometimes you don't remember which month a post you want to edit is) it would be a killer extension for big blogs. -- Radiant CMS Dev Mailing List Post: radiantcms-dev@googlegroups.com Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com Group Site: http://groups.google.com/group/radiantcms-dev/ To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Read More…
Fully support what Sean just said.
I already started doing some experiments with extensions as engines. Radiant would expose a couple of APIs more than Rails (navigation tabs, for instance), but that would be it. The rest would be up to Rails 3.
My suggestion is for both of us (Spree and Radiant) to try re-implementing our extension systems with Rails 3 engines and see how much we are required to add on top of that. Then, go for a merger.
What's tricky (in Radiant) is the API for hooking into the admin interface in various places (formerly known as Shards). I didn't find it optimal for some advanced needs. Also, on Rails 2.3.x the performance is not satisfactory. I don't know if Spree needs such functionality, but if it does, it's worth exploring a common solution for that which would scale in terms of performance and ease of use.
On Sat, Mar 27, 2010 at 16:01, Sean Cribbs <seancribbs@gmail.com> wrote: I'm not sure how much you guys have looked at Rails 3's implementation of Engines -- the standard Rails stack is implemented as one, even -- but it is exactly what extensions should have been, IMO. You can pretty freely compose applications together in ways that you could never do before. So, for creating a standard for extensions, it may not be necessary (other than helping people migrate away from the old API). On the other hand, it might be high time to decide how extensions should and should not interact, at least establishing some best practices. -- Radiant CMS Dev Mailing List Post: radiantcms-dev@googlegroups.com Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com Group Site: http://groups.google.com/group/radiantcms-dev/ To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Read More…
Hi Paul, Take a look at shallow nesting: http://guides.rails.info/routing.html#shallow-nestingHope this helps. /Lasse 2010/3/27 Paul A. <lists@ruby-forum.com> Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake routes command produce the following lines: GET /categories/:category_id/articles/:article_id/comments(.:format) {:controller=>"comments", :action=>"index"} category_article_comments POST /categories/:category_id/articles/:article_id/comments(.:format) {:controller=>"comments", :action=>"create"} new_category_article_comment GET /categories/:category_id/articles/:article_id/comments/new(.:format) {:controller=>"comments", :action=>"new"} GET /categories/:category_id/articles/:article_id/comments/:id(.:format) {:controller=>"comments", :action=>"show"} PUT /categories/:category_id/articles/:article_id/comments/:id(.:format) {:controller=>"comments", :action=>"update"} category_article_comment DELETE /categories/:category_id/articles/:article_id/comments/:id(.:format) {:controller=>"comments", :action=>"destroy"} edit_category_article_comment GET /categories/:category_id/articles/:article_id/comments/:id/edit(.:format) {:controller=>"comments", :action=>"edit"} GET /categories/:category_id/articles(.:format) {:controller=>"articles", :action=>"index"} category_articles POST /categories/:category_id/articles(.:format) {:controller=>"articles", :action=>"create"} new_category_article GET /categories/:category_id/articles/new(.:format) {:controller=>"articles", :action=>"new"} GET /categories/:category_id/articles/:id(.:format) {:controller=>"articles", :action=>"show"} PUT /categories/:category_id/articles/:id(.:format) {:controller=>"articles", :action=>"update"} category_article DELETE /categories/:category_id/articles/:id(.:format) {:controller=>"articles", :action=>"destroy"} edit_category_article GET /categories/:category_id/articles/:id/edit(.:format) {:controller=>"articles", :action=>"edit"} GET /categories(.:format) {:controller=>"categories", :action=>"index"} categories POST /categories(.:format) {:controller=>"categories", :action=>"create"} new_category GET /categories/new(.:format) {:controller=>"categories", :action=>"new"} GET /categories/:id(.:format) {:controller=>"categories", :action=>"show"} PUT /categories/:id(.:format) {:controller=>"categories", :action=>"update"} category DELETE /categories/:id(.:format) {:controller=>"categories", :action=>"destroy"} edit_category GET /categories/:id/edit(.:format) {:controller=>"categories", :action=>"edit"} As can be seen, each resource is ordered in a tree. So I believe that, it's could be interesting to simplify my routes such as for example: /categories/ => / /categories/:id => /:id /categories/:category_id/articles/ => /:category_id/articles /categories/:category_id/articles/:id => /:category_id/:id /categories/:category_id/articles/:article_id/comments/ => /:category_id/:article_id/comments /categories/:category_id/articles/:article_id/comments/:id => /:category_id/:article_id/:id It's more DRY, is't it? :) Does Rails 3 provides a easy way to do so, with an HTTP verbs mapping to controller actions automatically? Thanks anyone. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
i have a few remarks here; first, Re Jonathan Kinney about using the index page extension to organise a page's children. I think you misunderstood the idea of the extension. All the index- page extension does, is redirect requests to a certain page to it's first child when it does not have content on itself. This will not solve the problem of having too many pages to render in the backend nor the front-end. What you (mr jake) probably wìll want to implement, is the functionality of what used to be the admin-tree-extension. This extension was once put on the mailing list when we were still on radiant 0.6.something, and has pretty much dissapeared since. However, I have copied it's functionality into my gorilla-blog extension at http://github.com/jomz/radiant-gorilla-blog-extension This will change the behavior of pages with the ArchivePage class, so that, when you expand them in the backend, you get a list of years and under those months, that on their turn expand with the pages posted in their timelapse (am i making sense?). So, instead of getting a very long list of possibly thousands of pages, you drill down to a certain month and only get the pages posted in that month. We use this on a site that fits your description but is probably bigger and a little bit more complex: see http://belmodo.tv/ There you have live proof that a "big blog" can certainly be done with Radiant. I must honestly say, that when our clients are creating or updating content on high traffic moments, we do sometimes have performance hits. The problem being that for every page save, the entire cache is cleared, so in the minutes after that we get a lot of requests to uncached pages. Another thing that sometimes lowers performance is when we are under commentspam-attack, but that's not a Radiant issue since you always have to evaluate POSTs to a CommentsController. The site is now about 1.5 years old and building traffic, it now handles well over 80k page-views per month, and is running on a VDS with 256 MB Ram. I'll be happy to provide you with more details if you like, but I just attended a (scotland ruby) conference and have loads of work waiting for me next week, so it may take me a while to respond. Anyways, if you ask me, go go go! Regards, Benny On 26 mrt, 09:48, William Ross <w...@spanner.org> wrote: > On 26 Mar 2010, at 03:49, mr_jake wrote: > > > So, I still need to figure out if I should use Radiant for this > > project. I'm willing to try to build an extension that makes Radiant > > able to handle large amounts of pages, but I really don't have any > > idea what I'd be getting myself into. Would this simply be another > > extension or something that goes beyond what Radiant is meant to do > > and is going to require some heavy lifting? > > No, it's purely an interface question. The underlying machinery of radiant can easily handle a large and busy site, but the interface decisions have all been towards simplicity and obviousness. The main view is not optimised for a broad or a very deep page tree, so if that's what you've got then you might want to change the view a bit. You can either do that superficially, by restyling long lists so that they display in a more compact way, or in a more profound way by providing more ways to find the page you want. > > For my own purposes I've been working on a blog extension that will give an alternative to treating a blog as a collection of pages. I think in many cases blog entries should be treated as content to be displayed in a consistent way, not as separate pages. I haven't got far with it because of other work, but in the admin interface it would probably involve both a separate list page and a special treatment of that node in the page tree to show some recent entries. > > best, > > will -- Radiant CMS Dev Mailing List Post: radiantcms-dev@googlegroups.com Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com Group Site: http://groups.google.com/group/radiantcms-dev/ To unsubscribe from this group, send email to radiantcms-dev+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Read More…
Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake routes command produce the following lines: GET /categories/:category_id/articles/:article_id/comments(.:format) {:controller=>"comments", :action=>"index"} category_article_comments POST /categories/:category_id/articles/:article_id/comments(.:format) {:controller=>"comments", :action=>"create"} new_category_article_comment GET /categories/:category_id/articles/:article_id/comments/new(.:format) {:controller=>"comments", :action=>"new"} GET /categories/:category_id/articles/:article_id/comments/:id(.:format) {:controller=>"comments", :action=>"show"} PUT /categories/:category_id/articles/:article_id/comments/:id(.:format) {:controller=>"comments", :action=>"update"} category_article_comment DELETE /categories/:category_id/articles/:article_id/comments/:id(.:format) {:controller=>"comments", :action=>"destroy"} edit_category_article_comment GET /categories/:category_id/articles/:article_id/comments/:id/edit(.:format) {:controller=>"comments", :action=>"edit"} GET /categories/:category_id/articles(.:format) {:controller=>"articles", :action=>"index"} category_articles POST /categories/:category_id/articles(.:format) {:controller=>"articles", :action=>"create"} new_category_article GET /categories/:category_id/articles/new(.:format) {:controller=>"articles", :action=>"new"} GET /categories/:category_id/articles/:id(.:format) {:controller=>"articles", :action=>"show"} PUT /categories/:category_id/articles/:id(.:format) {:controller=>"articles", :action=>"update"} category_article DELETE /categories/:category_id/articles/:id(.:format) {:controller=>"articles", :action=>"destroy"} edit_category_article GET /categories/:category_id/articles/:id/edit(.:format) {:controller=>"articles", :action=>"edit"} GET /categories(.:format) {:controller=>"categories", :action=>"index"} categories POST /categories(.:format) {:controller=>"categories", :action=>"create"} new_category GET /categories/new(.:format) {:controller=>"categories", :action=>"new"} GET /categories/:id(.:format) {:controller=>"categories", :action=>"show"} PUT /categories/:id(.:format) {:controller=>"categories", :action=>"update"} category DELETE /categories/:id(.:format) {:controller=>"categories", :action=>"destroy"} edit_category GET /categories/:id/edit(.:format) {:controller=>"categories", :action=>"edit"} As can be seen, each resource is ordered in a tree. So I believe that, it's could be interesting to simplify my routes such as for example: /categories/ => / /categories/:id => /:id /categories/:category_id/articles/ => /:category_id/articles /categories/:category_id/articles/:id => /:category_id/:id /categories/:category_id/articles/:article_id/comments/ => /:category_id/:article_id/comments /categories/:category_id/articles/:article_id/comments/:id => /:category_id/:article_id/:id It's more DRY, is't it? :) Does Rails 3 provides a easy way to do so, with an HTTP verbs mapping to controller actions automatically? Thanks anyone. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Excellent, you are right. I thought I tried that but I have tried many combinations so I must have done it for something that was not persistent in itself. @@variable worked when in production mode. You made me a very happy camper. Thanks. Erik On 27 mar, 19:03, Frederick Cheung <frederick.che...@gmail.com> wrote: > On Mar 27, 5:33 pm, Erik Lindblad <e...@aldm.se> wrote: > > > Hi Colin and thanks for the suggestion. But the problem is more > > intricate than this, I am afraid. The reason I want to keep the object > > is that it connects via sockets to a pool of servers (at least 4 of > > them). When the object is marshaled, either for storage in the session > > or in the db these connections are lost. Maybe there is another > > solution but as I understand it the only way to keep these connections > > is to keep the object itself, not a serialized copy. > > I suspect class variables etc are only vanishing because you are in > development mode. In production mode they will persist. > > Fred
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
I tried parsing the YAML as given by Raghu, and it worked after fixing the "id:1" > "id: 1" error. /Lasse 2010/3/27 Colin Law <clanlaw@googlemail.com> On 27 March 2010 16:39, Raghu Maddali < lists@ruby-forum.com> wrote: > Colin Law wrote: >> On 26 March 2010 20:39, Raghu Maddali < lists@ruby-forum.com> wrote: >>> a YAML error occurred parsing >>> >>> �description: MyString >>> >>> photo_1: >>> �id:1 >>> �filename: train.jpg >> >> Have you double checked there are no tabs on the line above? >> Also try deleting it, retyping it, changing it to something that works >> then changing it back again etc etc >> Basically try things to get a handle on the problem. >> >> Colin > > Are you referring to the tab above photo_1/description...If you are > talking about tabs b/w filename: train.jpg,I'm sure that there are no > tabs b/w them except a single character space. There should be no tab characters anywhere in yaml files. Lasse is right that there should be space after id: in the line above. So having fixed that what was the result of my other suggestions? Deleting that line, retyping it, pasting in a line that you know works and so on. If the line in that position keeps giving an error whatever you do then it is probably the line above, I assumed Lasse's suggestion would fix it. Colin
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On Mar 27, 5:33 pm, Erik Lindblad < e...@aldm.se> wrote: > Hi Colin and thanks for the suggestion. But the problem is more > intricate than this, I am afraid. The reason I want to keep the object > is that it connects via sockets to a pool of servers (at least 4 of > them). When the object is marshaled, either for storage in the session > or in the db these connections are lost. Maybe there is another > solution but as I understand it the only way to keep these connections > is to keep the object itself, not a serialized copy. > I suspect class variables etc are only vanishing because you are in development mode. In production mode they will persist. Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Ryan, If you are using or can use passenger to serve your production env, then an alternative that would make this a non-issue would be to use passenger to serve your development env as well. That way you'd be able to use ssl in dev env just as you would in prod env. Another benefit would be that you'd also be able to test your prod env setup (ie subdomain, virtual-host, passenger/web-server, etc) by having a similar setup for your dev env. Jeff On Mar 26, 11:28 am, Robert Head <li...@ruby-forum.com> wrote: > class SecureAreaController < ApplicationController > > protected > > def ssl_required? > Rails.env.production? > end > > end > > class CreditCardController < SecureAreaController > > ... > > end > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Hi Colin and thanks for the suggestion. But the problem is more intricate than this, I am afraid. The reason I want to keep the object is that it connects via sockets to a pool of servers (at least 4 of them). When the object is marshaled, either for storage in the session or in the db these connections are lost. Maybe there is another solution but as I understand it the only way to keep these connections is to keep the object itself, not a serialized copy. Extremely grateful for any further input. Regards Erik On 27 mar, 17:52, Colin Law <clan...@googlemail.com> wrote: > On 27 March 2010 15:44, Erik Lindblad <e...@aldm.se> wrote: > > > Is there a way to create an object that is a singleton (one instance > > per user session) and is kept as long as the user session exists? The > > object handles a connection to a remote server that is very heavy to > > establish so I would like to reuse the same object in following > > requests. > > You have answered your own question, put it in the session. If it is > a large object then put it in the db and reference it from the > session. > > Colin
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On 27 March 2010 16:39, Raghu Maddali < lists@ruby-forum.com> wrote: > Colin Law wrote: >> On 26 March 2010 20:39, Raghu Maddali < lists@ruby-forum.com> wrote: >>> a YAML error occurred parsing >>> >>> �description: MyString >>> >>> photo_1: >>> �id:1 >>> �filename: train.jpg >> >> Have you double checked there are no tabs on the line above? >> Also try deleting it, retyping it, changing it to something that works >> then changing it back again etc etc >> Basically try things to get a handle on the problem. >> >> Colin > > Are you referring to the tab above photo_1/description...If you are > talking about tabs b/w filename: train.jpg,I'm sure that there are no > tabs b/w them except a single character space. There should be no tab characters anywhere in yaml files. Lasse is right that there should be space after id: in the line above. So having fixed that what was the result of my other suggestions? Deleting that line, retyping it, pasting in a line that you know works and so on. If the line in that position keeps giving an error whatever you do then it is probably the line above, I assumed Lasse's suggestion would fix it. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
On 27 March 2010 15:44, Erik Lindblad < erik@aldm.se> wrote: > Is there a way to create an object that is a singleton (one instance > per user session) and is kept as long as the user session exists? The > object handles a connection to a remote server that is very heavy to > establish so I would like to reuse the same object in following > requests. You have answered your own question, put it in the session. If it is a large object then put it in the db and reference it from the session. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
Colin Law wrote: > On 26 March 2010 20:39, Raghu Maddali < lists@ruby-forum.com> wrote: >> a YAML error occurred parsing >> >> �description: MyString >> >> photo_1: >> �id:1 >> �filename: train.jpg > > Have you double checked there are no tabs on the line above? > Also try deleting it, retyping it, changing it to something that works > then changing it back again etc etc > Basically try things to get a handle on the problem. > > Colin Are you referring to the tab above photo_1/description...If you are talking about tabs b/w filename: train.jpg,I'm sure that there are no tabs b/w them except a single character space. Raghu -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Read More…
|