similar to: Re: Help with RoR partial views

Displaying 20 results from an estimated 5000 matches similar to: "Re: Help with RoR partial views"

2006 Mar 22
3
stack level too deep error : Pulling my hairs out
Hello, I''ve changed something in my test application and since I can''t find the cause of the "stack level too deep" raising on every request. I''ve removed almost every part of code and the error still occurs, eg with this url : www.myhost.com/main/index routes.rb (nothing else in this file) map.connect '':controller/:action/:id''
2006 Jun 18
2
Why can''t I use a session? (Symbol as array index)
Hi All I can''t for the life of me see what is wrong with this. Maybe it''s cause it''s midnight... I want to put some data in a session and I have some code like this: class ApplicationController < ActionController::Base model :mything def ApplicationController.chosen_thing session[:chosen_thing] ||= MyThing.defaultThing end end So whenever I try to
2008 Jul 28
0
Rubygems Issues
I recently upgraded a server''s rubygems from 0.9.0 to 1.2.0. Upon doing so, one of our apps that uses soap4r thinks all the security certificates it sees are invalid (see Error 1 below). I tried reverting to 0.9.0, but anything that uses rubygems crashes now (see Error 2 below). If anyone could help me solve either problem, that would be great. Ideally, I''d like to run the latest
2006 Jan 04
0
Simple print statement (was: recongizing the current controller in views)
All (and kevin), After flying high for a while on Rails things, I''m down to the nitty gritty of Ruby stuff. Messing with vars and printing them out on a web page. I found the controller_path in the API docs; However when putting this in a controller: @test1 = controller_class_name @test2 = controller_name @test3 = controller_path And this in a partial: Test1 <%= @test1
2008 May 02
1
names of select elements inside a fields_for block not generated as expected
Hey All, I''m trying to play along w/the ''complex forms 1'' railscast (http://railscasts.com/episodes/73) and having trouble. The view is projects/new. I''m trying to add some project_people to the form w/code like so: <% form_for(@project) do |f| %> [project stuff here] <% for pp in @project.project_person %> <% fields_for
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 Jul 16
1
Helpers for partials too ?
MainController implies main.rhtml, which will automatically have access to the methods inside MainHelper (in \app\helpers\main_helper.rb). Should not the partial templates called from main.rhtml via <%= render :partial => ''partial'' %> also have access to the methods in main_helper ? I have tried <% display_dates = create_display_dates(@events) %> and <%
2007 Jan 01
0
Simple question on inserting child data
after doing a bunch of reading I have finally sat down to create a simple app to dirve home a lor of the concepts to which have been read. So I figured a simple blog app is the best way to do it. The bad thing is that I am already hung up when creating replies to a blog posting. I can''t figure out how to insert the post_id value into the reply table. When creating a reply the user is
2005 Mar 15
0
0.10.0, Routes and Query strings
So I made the leap to 0.10.0 but I can not get routes to play nice with query strings... I have this mapping in my routes.rb file map.connect '':controller/:action/:id'', :controller => ''main_controller'' This is all cool and everything works fine http://www.siteroot.com/ maps to http://www.siteroot.com/main_controller/index But when I add a query string to
2008 Oct 16
4
Removing values from a select (drop-down) box
Hello, I am working on a project, and on one form we have a select (drop- down) box where the user needs to be able to select from a list of clients. The box is currently being populated with: <%= collection_select(:client, :id, @account.clients, :id, :name) %> The problem is that some of these clients may have already been selected, and we need to remove them from the list. Is this
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my products_controller: require File.dirname(__FILE__) + ''/../test_helper'' require ''products_controller'' # Re-raise errors caught by the controller. class ProductsController def rescue_action(e) raise e end end class ProductsControllerTest < Test::Unit::TestCase fixtures
2008 Jul 22
2
ActiveRecord Associations issue
Hello all and thank you for reading this message. I am new to RoR, and ruby too, but i am quite excited about it. I am developing a RoR project and with active record associations in the following manner # Tables (all tables have only one record) CREATE TABLE `webcars_development`.`cars` ( `id` int(11) NOT NULL auto_increment, `model_id` int(11) NOT NULL default ''0'',
2006 Mar 29
3
Grouping Controllers into Modules - Doesn''t work!?
Ok, what I want to achieve is: http://<mydomain>/admin/products calls app/controllers/admin/products_controller.rb According to Agile Development with Rails this should work. I executed the follwing commands: rails myproj cd myproj script/generate controller Admin script/generate scaffold Admin::Product this creates app/controllers/admin/products_controller.rb all the views &
2008 Dec 21
1
Form issues : partials + AJAX vs simple JS / separate views + form_fors vs one view and fields_fors
Hi all! I am coding an application that keeps track of request to create college courses. An identified user (logically a faculty member) completes a form indicating the name of the course, the professor in charge, the course''s code, the date and place, the possible coprofessors and TAs and the type of website he or she wants to use as a teaching help (WebCT, Sakai, etc.). I have two
2006 Apr 28
3
Error with show.
Hello everyone, I have a problem while opening something like /main/show/1 Here is the template for show.rhtml <% for name in @names %> <div> <h2><%= name.full_name %></h2> </div> <% end %> And here is the code specific to the show on the main_controller.rb def show name = Name.find(params[:id]) end And here is the error im getting. You have a
2006 Mar 22
2
What is wrong in this method??????
Hi, This is my definition of method "add_to_cart" ======================= def add_to_cart count=params[:product][:count] while count.to_i>=0.to_i if params[:product][''dem_quantity''+count.to_s]=="" else @product = Product.find(params[:product][''product_id''+count.to_s]) print @product.name
2007 Mar 22
2
method to display the result of find (..) in a view
I''ve been trying to write a method that effectively displays the result of a find() for say.. my Customer model. What i''ve come up with is this: 1. The controller My main controller first makes the query via the model class MainController < ApplicationController def index order =
2005 Dec 28
3
Module loading
I''ve looked high and low for the answer to this and can''t seem to find anything that helps. I have an admin section (much like Typo) where all controllers are based on the Admin::BaseController. My directory structure is [RAILS] -app --controllers ---admin ----base_controller.rb ----products_controller.rb Products controller is: class Admin::ProductsController <
2006 Apr 12
3
noob question
Hi *, I am writing my first app based on the ''depot'' application but with some suttle differences to help me learn. I am a bit sutck with following and would be grateful for any help: I have the following controller: class MainController < ApplicationController def index @objects = Object.certified_items end end This relates to a field called
2006 Mar 17
1
How to update values in database in this form?
Hi, This is my rHtml page & Corresponding actions & model pages:- ===listform.rHtml================= <h1>Products List</h1> <%= start_form_tag(:action => "add_to_cart")%> <table> <tr> <% i=0 %> <th> Product No. </th> <th> Unit Price </th> <th> Available Qty. </th> <th> Demand Qty. </th>