Displaying 20 results from an estimated 10000 matches similar to: "View Directory Structure"
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 Apr 03
8
Layout problem
Hi,
I am creating a blog to learn ruby on rails. The blog.rhtml in the
layout folder has a the following code
<td width=150 valign="top">This is the left menu</td>
<td width=600 valign="top"><%= @content_for_layout %></td>
<td width=150 valign ="top"><%= render :partial => "categorylist",
:collection =>
2006 Apr 07
3
Ajax render a template
In my blog a user can add comments. I want an Ajax call to add the
comment to the bottom of the comments list.
How to i return a comment thats is in the comment template and add it to
the bottom of the page. I have gotten as far as rendering some text
back to the form and the comment doesn''t display until i refresh.
This is my _newcomment.rhtml form to create a new comment
<div
2005 Jan 24
1
how can i override the show view to capture show/n , show/n+1, etc.
Hi -
Yet another rails newbie ...
I have a simple list view rhtml with data returned from a db and
displayed within a table. Each row has a show action link_to based on
the id field in the table row.
i.e.
http://127.0.0.1:3000/myapp/show/1
http://127.0.0.1:3000/myapp/show/2
http://127.0.0.1:3000/myapp/show/3
I want to override the default show view but I don''t understand how I
can do
2006 Feb 04
4
Dynamic loading view from DB
Hi All,
I am looking for a way to dynamically load a view, inside a template, based
on uri that does not officially exist inside of rails. i.e. a typical CMS
system such as wordpress that stores the html from the pages in a database.
I have found a page on the the rails wiki (
http://wiki.rubyonrails.org/rails/pages/HowToRunAnActionBeforeRoutes) that
seems to be what I want, but lacking a few
2006 Apr 11
5
RJS adds comment but doesn''t update form
Hi,
When a user adds a comment i want to add the comment to the end of the
comments list using ajax so there is no full page refresh. The code i
have below adds the comment to the database but doesn''t update the
comments div with the new comment.
Can anyone help? This is my first use of rjs templates and i have read
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
2005 Dec 24
10
can''t find view from Mailer?
Hi everyone,
Like so many other here, I too am new to Rails (and Ruby), and so far
it''s been a great experience. I haven''t been able to get around one
problem though. When trying to use the mailer, I recieve an error like
this:
ActionView::ActionViewError in Tell_friend#send_email
No rhtml, rxml, or delegate template found for send_to_friend
The scenario is this:
A form on
2005 Dec 31
7
Application Errors w/ layout & custom view pages
1) I get Rails Application Error when trying to use layout
test_controller
def list
layout "stdlayout"
end
in the views/test/layouts stdlayout.rhtml
<html>
<head><title>test</title></head>
</body>
<h1>Test</h1>
<%= content_for_layout %>
</body>
</html>
2) I get Rails Application Error when trying to use a separate
2006 Aug 03
5
DRYing up the view
Hello everyone!
I have generic views for CRUD operations
For example I render(''shared/list'') from controller
shared/list.rhtml
...
<% for item in @list %>
<tr class="<%= cycle ''list-line-odd'', ''list-line-even'' %>">
<%= render :partial => ''item'', :locals => { :item => item } %>
2006 May 10
2
newbie q on displaying a db field value in the view
My layout calls a few links like so:
<%= link_to ''| Home '', :controller => ''search'', :action => ''''%>
<%= link_to ''| Search '', :controller => ''search'', :action => ''''%>
I would also like to display two values from my user table in the same
layout right after the
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in
the browser.
<h1>New member</h1>
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
<fieldset>
<legend>Member Info</legend>
<p><label for="member[first_name]">First Name:</label> <%=
2007 Nov 19
2
Help with controller and view
I have the following models
class Recipe < ActiveRecord::Base
has_many :ingredient_recipes
has_many :ingredients, :through => :ingredient_recipes
end
class IngredientRecipe < ActiveRecord::Base
belongs_to :ingredient
belongs_to :recipe
end
class Ingredient < ActiveRecord::Base
has_many :ingredient_recipes
has_many :recipes, :through => :ingredient_recipes
2005 Mar 08
3
Making a module method available in view
I have a Rails application called RailsApp. In my RailsApp/lib
directory, I have a file called localization.rb that defines a module
called RailsApp with a Localization class that implements a method l.
(RForum devs and fans will recognize this as the YAML-based
localization feature in that package.)
I want to be able to call this method from my controllers and views.
I have added a
2005 Mar 07
2
erb and builder in same view ....
Has anyone tried using erb and builder in the same file?
Either .rxml or .rhtml?
I''m wanting to do some think like the following:
xml.div(''id''=>''menu'') {|xml|
link_to "create race", :controller=>"derby", :action=>"new"
}
Thanks,
-- Tom.
--
"Nothing will ever be attempted, if all
possible objections must
2007 Sep 11
1
TypeError => Symbol as array index
Hello,
I''ve got a controller, which I''d like to protect from being accessed by
untrusted users. I saw that you can use before_filter to do it.
I tried before_filter :filter on the page I''d like to protect and then
creating a private method on the super class and it works. I''d now like
to get some information from the controller ... So I tried before_filter
2006 Jun 07
6
Links on the left hand side - are components necessary?
Hello,
Maybe this is super-trivial...
I need to have a list of links on the left hand side of my application,
for *every* single page.
So, I''ve created a layout called "main" (main.rhtml) under
view/layouts, and included >layout "main"< in pretty all of my
controllers.
main.rhtml has, amongst all the other HTML stuff:
<%= render_component
2006 Mar 18
2
Need help with my view populating rows
Hello, I was talking with someone in IRC, trying to get one form with
however many fields to make new rows. He worked with me on the controller,
but then I didn''t get the help with the view I needed, and I''ve been trying
to do it on my own.
I''m uploading pictures to my Pictures table. As you know, I need a few
fields for each picture. I''ll need the filename,
2006 Jan 03
3
Engine and controller layout confusion
Hi all,
Installed the login_engine which is working. But I''m confused as to how I tell
Rails to use the "/app/views/layout" rhtml files, when partials from the
login_engine are used from "/vendor/plugins/login_engine/app/views/user".
Do I copy login.rhtml to /app/view/mgmt?
(mgmt is a controller name in my app)
Along the same line:
I also have a nil error on the
2007 May 09
5
layouts + routes = confused
I''m new to RoR and the tutorials I''ve found on the web, while helpful,
aren''t as "complete" as I''d like them. I understand the basics when
it comes to layouts and routes, but I''m trying to get them to work
together.
MY first task was to implement a user authentication system
(registration/login/logout/change_password). This works fine with
2006 Apr 27
2
problematic admin/views
ok, i have a pretty almost finished (frontend) blog, i have defined an
admin zone with authentication to add content, now im getting trouble
with the views for the controllers in the admin zone, here you can see
my file structure:
http://img284.imageshack.us/my.php?image=tmpviews6oq.gif
and my admin controllers like this:
controllers/admin/admin_controller.rb
class Admin::AdminController