Displaying 20 results from an estimated 12177 matches for "book".
2009 May 27
4
Scaffolding Results Format
Hi Everyone,
I built a scaffold and I''m having trouble getting results properly
formatted. (I need to get the data into multiple columns instead of just
one big column) I can''t get all of my CSS to work properly in
scaffold.css, layout/books.rhtml, or the books/index.rhtml.erb Anyways,
maybe you have a suggestion.
Default view (127.0.0.1:3000/books)
Title Abstract
Book One Book One Abstract Show Edit Destroy
Book Two Book Two Abstract Show Edit Destroy
Book Three Book Three Abstrac...
2006 Mar 04
10
Help setting up relationships needed
This is a bit of a long question, but to those of you with some
experience, it should be fairly simple I think.
I have a notes page that should list all notes the user has entered for
all books chronologically like this.
Book One: This is the note.
Book Four: This is the note.
Book One: A different note, entered later.
Right now my models are:
User
has_many :books
Book
has_many :notes
belongs_to :user
Note (has column book_id)
belongs_to :book
has_one :book
The Not...
2011 Jun 11
1
Having a problem adding a foreign key
I keep getting this exception "SQLite3::SQLException: no such
column: books.user_id: SELECT "books".* FROM "books" WHERE
("books".user_id = 4)" ,which sounds like there is no user_id in books
table.So i just installed foreigner plugin and added "
t.integer :user_id, :null => false" and
"add_foreign_key(:books, :users)&q...
2006 Feb 08
1
Weird validation issue
...for
certain attributes and, for some reason, it''s also affecting things
outside of validation.
For campers on certain camp types, we require some information about
their school. I tried to validate the information this way:
validates_presence_of :school_type, :if => Proc.new { |c|
!c.booking.nil? and ( c.booking.camp.camptype == Camptype.find(:first,
:conditions => [ ''name = ?'', "Children''s Camp"]) or
c.booking.camp.camptype == Camptype.find(:first, :conditions => [
''name = ?'', ''Adventure Camp'']) ) }
vali...
2009 Jul 31
8
Would like include model association in to_xml
i have:
class Library << ActiveRecord::Base
has_many :books
end
class Book << ActiveRecord::Base
belongs_to :library
end
in my controller i have:
render :xml=> Library.find(:all).to_xml(:include=>books)
but, i would like put a condition in the books ( e.: pages >= 100 )
i would like to create a xml with all Libraries, but books with...
2006 Jan 18
2
categories/recipes & books/descriptions - has_many vs has_one => id question
People,
In the cookbook eg, categories has_many recipes but in a book eg, book
has_one description - doesn''t that mean that the id of the description
should be the same as the id of the book (instead of having it''s own
"description_id" in the book table?
Thanks,
Phil.
--
Philip Rhoades
Pric...
2007 Mar 27
2
activerecord failed?
Hello all,
i found something wrong (or maybe i was wrong?)
this looks like a rectiverecord bug , can anyone help me to point
out what''s going on?
------------------migration
create_table :books do |t|
t.column :name,:string
t.column :person_id,:integer
end
create_table :people do |t|
t.column :name ,:string
end
------------------model
class Book < ActiveRecord::Base
belongs_to :person
end
class Person < ActiveRecord::Base
has_many :books
end
---...
2011 Apr 25
30
NoMethodError in Book
I got a following error.
NoMethodError in Book#new
Showing /home/amrit/boook/app/views/book/_form.html.erb where line #1
raised:
undefined method `model_name'' for NilClass:Class
The content of _form.html.erb file are:
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation&quo...
2007 Jul 24
4
Possible Bug
I''m trying to test some code that has validates each and I''ve got a very
strange failure
Mock ''Book_1027'' expected :store_with_privacy? with (#<Clip:0x1a99b96
@name="Clip_1025">) but received it with (#<Clip:0x1a99b96
@name="Clip_1025">)
The Spec
it "should check that a book can save a clip" do
@user = mock_model( User, :id => 3 )...
2008 Nov 09
2
please recommend statistics, time series and econometrics books with finance, macroeconomics, trading and business applications
Hi all,
Please recommend good books for the following three categories. (I am
aim at finance, macroeconomics, trading and business applications).
(1) statistical (financial) data analysis;
(2) time series;
(3) econometrics.
More specifically, I am looking for the following two types of books:
(1) Books that provide big pictures a...
2006 Apr 18
2
check_box
I''ve got a question on the use of check_box.
***
This is working but there just has to be a better way:
RHTML:
<% for book in @books do %>
<tr>
<td><%=book.label%></td>
<td>
<%checked = book.subscribed ? ''checked'': ''nope''%>
<%=check_box("book" + book.id.to_s, ''checked'', :checked => checked)...
2007 Jun 07
4
checking associated objects have been deleted
I have the following model:
class Book < ActiveRecord::Base
has_many :taggings, :dependent => :delete_all
has_many :tags, :through => :taggings
end
is it possible to check that associated taggings are being destroyed
using mocks? I don''t want to test that rails is deleting the
associations, I want to test that I h...
2005 May 25
2
URLS and Human Factors
This post addresses URLs generated by Ruby on Rails from a human
factors point of view.
Allow me to use Hieraki as an example. Hieraki is a great
application. It was one of my first introductions to the power of
Ruby on Rails.
Scenario: When I navigated to Chapter 1 of a book the URL in my
address bar was http://www.library.com/read/chapter/6. This
inconsistancy ("Am I on Chapter 1 or 6?") threw me for a loop. I
navigated back to the book page (http://www.library.com/read/book/2)
to check the link again. With reduced confidence, I reclicked the
"Chapter...
2006 Feb 08
6
can''t get date_select to work
Hi,
I render a couple of date_select fields, the HTML looks fine, I can
see the values submitted back to the server, but AR doesn''t pick them
up from the hash in Booking.new(params[''booking'']).
I''ve got a ''booking'' object with parameters product, startdate and
enddate.
HTML snippets:
<select name="booking[startdate(1i)]">...
<select name="booking[startdate(2i)]">...
<select name=...
2006 Apr 05
3
CRUD pattern for has_many relationships (forms containing collections)?
Hello folks!
Beare with me for a second, while I explain my problem.
Assuming we have the trivial model of
class Author
has_many :books
end
class Book
end
How do people go about creating the authors/edit and authors/new
views if you want to be able to add and remove arbitrary amount of
Books at Author creation and edit time? What I mean by this is that I
go to ''authors/new'' then add a few Books and then c...
2017 Oct 06
1
ACL permission: give permission to move email into different folder
> On October 7, 2017 at 1:29 AM Aki Tuomi <aki.tuomi at dovecot.fi> wrote:
>
>
>
> > On October 6, 2017 at 11:44 PM Davide Marchi <danjde at msw.it> wrote:
> >
> >
> > On 06.10.2017 12:42:22, Aki Tuomi wrote:
> > [..]
> > >>
> > >> Maybe it is not possible with Dovecot?
> > >>
> > >> Many
2008 Dec 11
1
help needed regaring Acts As Taggable On Steroids
Hello,
In my rails application, I have a book model.
I want to add tags. For that I have installed
acts_as_taggable_on_steroids from this link
http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids
and do as the readme file.
This is my Model :
class Book < ActiveRecord::Base
acts_as_taggable
end...
2006 May 23
10
Ruby on Rails: Up and Running
hello,
On page 49 of the beta version of Ruby on Rails: Up and Running, the
book suggests to download a zip file containing everything that has been
done up to that point, and a create_tables_with_data.sql file. The book
doesn''t have the link, and I couldn''t find it in the book site. Does
anyone know where to get the files?
This is a very good book.
Thank...
2006 Jan 05
1
recipes/categories to books/authors but listing doesn''t work
People,
I have gone through the cookbook example:
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1
and everything worked fine an a FC4/Postgres setup.
I then tried to reproduce this success with something that would be
useful to me - a library db using books & authors tables. The author
list works but NOT the book l...
2005 Dec 29
3
Verification problems
...eem to be able to find
relevent information elsewhere.
I am having trouble getting the following to work:
Schema
======
ActiveRecord::Schema.define(:version => 1) do
create_table "authors", :force => true do |t|
t.column "name", :string
end
create_table "books", :force => true do |t|
t.column "title", :string
t.column "author_id", :integer
end
create_table "catalogs", :force => true do |t|
t.column "author_id", :integer
t.column "book_id", :integer
end
Models
======
cla...