Displaying 11 results from an estimated 11 matches for "bookcontrol".
Did you mean:
bootcontrol
2005 Dec 20
3
Single controller to browse things in categories
First off, hi, I''m [obviously] new :O)
Please excuse my question as I''m sure it''s been answered, but I can''t
find it anywhere.
I have a table of categories:
id name
1 Foo
2 Bar
I have things which belong_to categories:
id category_id subject date
1 1 my subject 07/09/2004
and Further classifications which belong_to categories:
id category_id name
1 1 More
2008 Mar 23
1
Object creation when the controller is a subclass of AdminController
...#39;'ve finally determined that the best way to handle administration of
a model that displays publicly but is administered privately is
through subclassing but I''ve run in to pathing issues (I think) when
trying to create an instance of my model.
Let''s say I have a Book, and BookController is a sublcass of
AdminController so that I can create and delete Books via an Admin
section. Everything is going smoothly, I''ve set up my resources so
that my controller falls under /admin but it seems to me like my "new
Book" form generates it''s action path for book...
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">
<h2><%=
2008 Dec 11
1
help needed regaring Acts As Taggable On Steroids
...ActiveRecord::Base
acts_as_taggable
end
Here is my ApplicationHelper :
module ApplicationHelper
include TagsHelper
end
And I couldn''t get the idea what should I add in the controller to save
tags(please guide me to save tags) . I just try to follow the readme and
Edited part of BookController is:
def create
@book = Book.new(params[:book])
@book.tag_list # []
@book.tag_list = "Funny, Silly"
respond_to do |format|
if @book.save
flash[:notice] = ''Book was successfully created.''
format.html { redirect_to(@book) }
f...
2008 Dec 23
2
NoMethodError in Book#show_subjects
...#1):
1: <h1><%= @subject.name -%></h1>
2: <ul>
3: <% @subject.books.each do |c| %>
4: <li><%= link_to c.title, :action => "show", :id => c.id -%></li>
I have two tables in my database : books and subjects
The Controller is
class BookController < ApplicationController
layout ''standard''
def list
@books = Book.find(:all)
end
def show
@book = Book.find(params[:id])
end
def new
@book = Book.new
@subjects = Subject.find(:all)
end
def create
@book = Book.new(params[:book])
if...
2012 Jan 05
4
mySQL: ERROR 1045: Access denied for user 'root'@'localhost' (using password: NO)
...oot
password: password
host: localhost
---------------------------------------
The development log is showing like this
"
Rendering C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb
(internal_server_error)
Processing BookController#index (for 127.0.0.1 at 2012-01-05 13:22:31)
[GET]
Session ID:
BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo
%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--
d8a35d2303977ea5f70494b175549ff7959c5ee9
Parameters: {"action"=>"index", "controller"=>"book&...
2011 Jun 11
1
Having a problem adding a foreign key
...gt;</p>
<p><%= b.title%></p>
<%end%>
HOME CONTROLLER
class HomeController < ApplicationController
def index
@user = current_user
@user.books||=Book.new
@books=@user.books
end
end
BOOK CONTROLLER
class BookController < ApplicationController
def new
@books = Book.new
# redirect_to :controller=>"home" ,:action=>"index"
end
def create
@books = Book.new(params[:book])
if @books.save
render "home/index"
#redirect_...
2005 Dec 22
11
rforum engine
Here''s a question for those well-versed in rforum or engines -- or
both, ideally :) I''ve spent some time today turning RForum into an
engine, using rails 1.0, engines trunk, and rforum 0.1 (as rforum
trunk didn''t appear to work out of the box).
My rforum engine works, but only when I do two things that I found by
trial and error:
1) All rforum controllers subclass
2006 Feb 13
1
autocomplete input field name
...plete:
show.rhtml
...
<form action="/book/addauthor" method="get">
<%= text_field_with_auto_complete :author, :name %></p>
<input name="bookid" value="<%= @book.id %>" type="hidden">
...
book_controller.rb
class BookController < ApplicationController
auto_complete_for :author, :name, :limit => 5
def addauthor
@book = Book.find(params[:bookid])
@author = Author.find_by_name(params[:authorname])
@book.authors.push(@author)
redirect_to :controller => ''book'', :action => '...
2006 Mar 19
1
Rails and REST Example
Does anyone have an example of using REST and submitting data through
a POST operation and then possibly loading that data with
activerecord.
Also, if you have client code written in another language (java,.net,
C), would you have that code as well?
Berlin Brown
2007 Mar 06
59
Memory leaks in my site
Hi all,
My environment is ruby-1.8.4, rails 1.2.2, mongrel 1.0.1, linux 2.6. Now, i
have a problem on memory leaks with mongrel. My site is running 5 mongrel
processes on a 2G RAM machine, the memory of each process grows from about
20M to about 250M, but it never recover to the initial 20M, so i had to
restart the mongrel processes once per day. The load is about 1M hits per
day.
Waiting for