similar to: How to automatically set params based on passed object when generating a route?

Displaying 20 results from an estimated 11000 matches similar to: "How to automatically set params based on passed object when generating a route?"

2009 Dec 03
2
Dynamic Paths
Hey there, I''m in the muck of a major rails project, and need a bit of advice. Google isn''t much help in this case, so I came here. I''m trying to set up a URL structure as follows: url.com/username/blog/post_id where the user has_many posts and the post belongs_to user. I''m using the friendly_id plugin to enable easy lookup with the user''s username,
2008 Apr 14
2
Problems with nil object
Hi to all. I''ve a very big problem. I know this can seem very loing, but please, try to read it. I have a simply blog, with posts and their comments. I''ve two tables in my db, posts, with post id, text and comments_count to store the number of comments-children of each post (as recomanded to do in AWDWR); and the table comments, with comment id, post_id for the post
2007 Aug 23
1
validation across controllers
Hello, here is my issue with an exemple! Typical example: post and comments in REST design ------------------------------------------------------------------------------------------------------------------------------------- class PostsController < ApplicationController ... def show ... @comments = @post.comments.find(:all, :order...blabla) end ... end
2007 Jul 31
0
Edit not working with named routes
HELP! I''m a relatively new rails user and I''m stuck. I''m trying to build a relatively simple blog and I decided that I liked the way named routes look in the code. So I added map.resources :posts to my routes.db file. I then went through and updated my controller to take advantage of the named routes that were generated. I also updated all of my views and everything
2014 Mar 31
0
Unable to delete post in sample blog application
Hi All, I am new to RoR and I am writing a small blog application. I have added a Destroy / Delete link to the post index, but when I click this delete link the show action is fired. The log seems to confirm this: Started GET "/posts/2" for xxx.xxx.xxx.xxx at 2014-03-31 15:51:03 +0000 Processing by PostsController#show as HTML Parameters: {"id"=>"2"} Post
2017 Jul 13
0
Rebalance task fails
Hi Szymon, I have received the files and will take a look and get back to you. In what context are you seeing index? Thanks, Nithya On 11 July 2017 at 01:15, Szymon Miotk <szymon.miotk at gmail.com> wrote: > Hi Nithya, > > the files were sent to priv to avoid spamming the list with large > attachments. > Could someone explain what is index in Gluster? > Unfortunately
2017 Jul 13
2
Rebalance task fails
Hi Nithya, I see index in context: [2017-07-07 10:07:18.230202] E [MSGID: 106062] [glusterd-utils.c:7997:glusterd_volume_rebalance_use_rsp_dict] 0-glusterd: failed to get index I wonder if there is anything I can do to fix it. I was trying to strace gluster process but still have no clue what exactly is gluster index. Best regards, Szymon Miotk On Thu, Jul 13, 2017 at 10:12 AM, Nithya
2006 Apr 20
1
Returning Count from find_by_sql
I want to return an int from a find_by_sql call. But when I use that result to compare to another count the error tells me I have an array. MODEL: # Returns the number of comments in a specified post def self.find_count(post_id) find_by_sql(["SELECT COUNT(*) FROM commments WHERE post_id = ?", post_id]) end CONTROLLER: def test @post =
2007 Jul 06
0
Removing One Element From a Serialized Form
Hi all, I''m trying to serialize a form with the exception of one specific element. Serializing the form in a hash (without pulling out specific elements) works: <li> <%= link_to_remote ''(Save)'', {:url => post_path(@post), :with => "$ (''post_form'').serialize(true)" }, :method => :put %> </li> The generated code
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe one of you guys can help me out. I''ll show my sweeper and then my log to show that it "should" be working. class PragmaticSweeper < ActionController::Caching::Sweeper observe Comment def after_save(comment) expire_page(comment.post_id) end private def expire_page(post_id)
2005 Mar 18
0
ARP queries generating entries in routing cache
Hello! I''ve noticed a strange thing: when a client system generates an arp query for an unexistent host, the routing cache entry is being made. My system is Fedora 2 with vanilla 2.6.11. the client is 10.1.1.2 with mask 255.255.0.0 the router/firewall is 10.1.1.1 with mask 255.255.255.0 Yes, the masks are different and this cannot be fixed easily. So, when the client generates ARP
2009 Apr 15
2
Getting Started with Rails - post_comment_url
Hi, Thanks for a wonderful Getting Started with Rails. I am up to the last section and just added the comments part. So while testing and looking over comments_controller.rb; I see the reference to post_comment_url calll where is this defined. Below is the message I am getting. Thanks ActionController::RoutingError (post_comment_url failed to generate from {:post_id=>#<Post id: 1, name:
2006 Aug 31
0
ActiveResource
I''ve been sitting on an ActiveResource patch for a few weeks, waiting to get some feedback from David. But, I see other folks like Jeremy are starting to use it, so I committed my patch: http://dev.rubyonrails.org/changeset/4890 It gets all the basic operations in working order, and adds support for prefixes. I wasn''t quite sure how to pull this off. Right now, I''m
2008 Jan 21
2
multiple ids on restful action
Hi, I know this question has come up before, but I couldn''t find a satisfying answer. Maybe I didn''t look well enough, so any pointers to old messages regarding this subject would be welcome too. I need some way to pass multiple ids to a resource. Something like /posts/13,14 If I do this I have to manually split the id on ","s in the action, and use post_path([post1,
2017 Oct 13
1
small files performance
Where did you read 2k IOPS? Each disk is able to do about 75iops as I'm using SATA disk, getting even closer to 2000 it's impossible Il 13 ott 2017 9:42 AM, "Szymon Miotk" <szymon.miotk at gmail.com> ha scritto: > Depends what you need. > 2K iops for small file writes is not a bad result. > In my case I had a system that was just poorly written and it was >
2012 Sep 25
3
Proposal for a new ActiveModel::Errors structure
There are few issues with the current ActiveModel::Errors class. Firstly, when an error is added to ActiveModel::Errors class via #add method (https://github.com/rails/rails/blob/master/activemodel/lib/active_model/errors.rb#L294) its translation is added. It should not be translated when being added, but only when being read. The second issue is a bit bigger. We''d like to create
2006 Oct 12
1
using speex in C#
You could compile Speex as a DLL (see libspeex_dynamic.dsp) and use PInvoke. http://en.wikipedia.org/wiki/PInvoke Note that Speex will still be executing as unmanaged code and your program will have the added dependency of the native Speex DLL. It appears that someone created a "Speex.NET" based on JSpeex, but I didn't find any useful info on it. You may want to search for this
2006 Apr 01
10
You have a nil object when you didn''t expect it!
Hi, I am creating a blog to learn ruby on rails. I have 2 different views/models/controllers, 1 called post and 1 called comments. How do i link a post from the views/post directory to the comments that belong to the post in the views/comment directory. This is the code in the post/show.rhtml <%= render :partial => "post", :object => @post %> <%= link_to
2006 Oct 16
6
Rails AR/Oracle Unit Test: [5310] failed (but getting better)
"rick" has given AR/Oracle some love, but it''s still unhappy... http://dev.rubyonrails.org/changeset/5310 ------------------------------------------------------------------------ r5310 | rick | 2006-10-16 08:42:55 -0700 (Mon, 16 Oct 2006) | 1 line Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
2017 Jul 10
2
Rebalance task fails
Hi Nithya, the files were sent to priv to avoid spamming the list with large attachments. Could someone explain what is index in Gluster? Unfortunately index is popular word, so googling is not very helpful. Best regards, Szymon Miotk On Sun, Jul 9, 2017 at 6:37 PM, Nithya Balachandran <nbalacha at redhat.com> wrote: > > On 7 July 2017 at 15:42, Szymon Miotk <szymon.miotk at