Displaying 20 results from an estimated 5000 matches similar to: "Simple question on inserting child data"
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
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
2010 Jan 05
0
Problem with associating comments with blog posts on same page
Hi,
I will admit I am very new to ruby and I am trying to do something
that is not in any tutorials I have found. If you see a more
conventional way to do some of the things I am trying to do, please
let me know.
What I am trying to accomplish. People can edit the comments on the
same page as the listing of posts. The problem is that when I go to
create the comment, it is not getting associated
2006 May 06
1
Ajax commenting - PLEASE HELP!!!!
I''m trying to post comments using Ajax. It seems that I have an
infinite loop somewhere, because it hangs on the return from the Ajax
call. The comment does get saved to the DB, but I have to refresh the
page for it to show.
The reason I know it''s some sort of infinite loop, is because I''m
showing a "loading.gif" image, and it never goes away. Plus, if
2006 Jun 20
0
No opening form tag in rendered HTML
I cannot get my form to submit for my simple blog site (based on the "How to Build a Blog Engine in 15 Minutes" presentation)
Any ideas?
Thanks,
Tom
----------------------------------------------------------------------------
Here is my code:
#Post controller
class PostsController < ApplicationController
def index
list
render :action => ''list''
end
2010 Dec 16
1
defining a formula method for a weighted lm()
In the vcdExtra package on R-Forge, I have functions and generic methods
for calculating log odds ratios
for R x C x strata tables. I'd like to define methods for fitting
weighted lm()s to the resulting loddsratio objects,
but I'm having problems figuring out how to do this generally.
# install.packages("vcdExtra", repos="http://R-Forge.R-Project.org")
2011 Jul 06
5
Monkey patching a gem (rails_admin, with Rails 3)
Hi.
I''m trying to monkey patch the rails_admin gem.
First, I tried to add a file in config/initializers containing:
RailsAdmin::MainController.class_eval do
def get_sort_hash
CODE HERE...
end
end
It was only loaded once, and then the method from the gem was always
executed instead of mine.
I also tried to add the code in lib/ with the correct line in
config/application.rb to load
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 =
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)
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:
2015 Mar 09
0
rsync hangs on select() system call
hello ,
any suggestion about this problem ?
thanks
2015-02-27 15:46 GMT+01:00 thomas veymont <thomas.veymont at gmail.com>:
> hello,
>
> trying to understand why a rsync client hangs during a transfer. Hopefully
> someone can advise.
>
> client = rsync 3.0.6, server = rsync 3.1.1 , transfer is done to a rsync
> module with such a command:
> rsync -rtxvvv my_data
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
2015 Feb 27
2
rsync hangs on select() system call
hello,
trying to understand why a rsync client hangs during a transfer. Hopefully
someone can advise.
client = rsync 3.0.6, server = rsync 3.1.1 , transfer is done to a rsync
module with such a command:
rsync -rtxvvv my_data rsync://test at my.rsync.server/INCOMING/
<rsync://test at rsync.resif.fr/INCOMING_TEST/>
the client starts to transfer data (a few Mb) then hangs, then manually
2017 Nov 27
0
Scatterplot of many variables against a single variable
Hi Engin,
Sadly, your illustration was ambushed on the way to the list. Perhaps
you want something like this:
# proportion of useful answers to your request
pua<-sort(runif(20))
#legibility of your request
lor<-sort(runif(20))+runif(20,-0.5,0.5)
# is a data set provided?
dsp<-sort(runif(20))+runif(20,-0.5,0.5)
# generate a linear model for the above
pua.lm<-lm(pua~lor+dsp)
# get the
2008 Jul 24
0
Errno::EBADF Send an Email in Rails using GMail
Hi,
would someone please help me. I have been desperatley trying to fnd
out for the last two days why the following code is not working. Any
ideas.
I''m running Instant Rails 1.4 / Rails version 1.2.5 / Ruby version
1.8.5 (i386-mswin32) / RubyGems version 1.1.1 / Action Mailer version
1.3.5 / Windows XP.
Here is a description of my emailing application:
in
2006 Sep 07
6
form_for - Child object - how to set parent id
Hi All,
I am just trying to learn ruby/rails so please don''t flame me if this is
a stupid question.
As a learning project I decided to create my own blog using ROR. I have
created a controller that shows paged blog entries, and below each blog
is a list of comments along with a form alowing the user to add a new
comment.
To create the form for the comment entry I used form_for
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 Nov 27
0
Scatterplot of many variables against a single variable
Dear Berger and Jim
Can you see my eviews example in the annex? (scattersample.jpg)
Sincerely
Engin
2017-11-27 13:27 GMT+03:00 Eric Berger <ericjberger at gmail.com>:
> LOL. Great reply Jim.
> (N.B. Jim's conclusion is "debatable" by a judicious choice of seed. e.g.
> set.seed(79) suggests that making the request more readable will actually
> lower the number of
2017 Nov 27
3
Scatterplot of many variables against a single variable
LOL. Great reply Jim.
(N.B. Jim's conclusion is "debatable" by a judicious choice of seed. e.g.
set.seed(79) suggests that making the request more readable will actually
lower the number of useful answers. :-))
On Mon, Nov 27, 2017 at 11:42 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
> Hi Engin,
> Sadly, your illustration was ambushed on the way to the list. Perhaps
2006 Jul 03
0
Check if row already exists?
I''m working on a system that has a series od "bids" associated with
"posts". Vurrently when a bid is placed I have it creating a new row
each time in the "bids" table. The bids table has id, post_id, and
user_id.
The logic is to check to see if a bid already exists with a given
post_id and user_id. If it does, then just update the "amount"