similar to: Why app/helpers are not app/view/helpers ?

Displaying 20 results from an estimated 1000 matches similar to: "Why app/helpers are not app/view/helpers ?"

2006 Jul 06
5
Single table inheritance
I''m having a class called Person, with subclasses as goalkeeper, forward, defender. Now a person can be a forward as well as a defender or a goalkeeper. I want to use single table inheritance like : class Goalkeepr < Person end And not have multiple boolean columns like in my people table like is is_goalkpeer, is_forward, is_defender. How do I go about it ? Thanks, Pratik -- rm
2006 Jul 24
6
error_messages_for not working
I have the following code and I am not able to get it working. The error message is not coming on the top, it is just getting displayed on a different page if I dont have the rescue block commented at the bottom. Model: user.rb require "digest/sha1" class User < ActiveRecord::Base validates_presence_of :eaddress, :fname, :passwd, :pcode, :country, :day, :year, :month, :gender,
2006 Jul 20
16
Juggernaut Released - (a.k.a Armageddon)
I''ve just released Juggernaut - a plugin for ruby on rails. Check out the site: http://juggernaut.rubyforge.org I?ve also finished a demo that illustrates some of Juggernuat?s capabilities. You can sign up for an account here: http://alexmaccaw.no-ip.info:3500/login/sign_up . It might be a tad slow as it?s running from my home machine. Juggernaut for Ruby on Rails initiates a flash
2006 Jan 14
4
hide_action doesnot hide view
The view file (eg. apps/views/items/list.rhrml) is still displayed even when the action is hidden (hide_action :list). How can I hide view file form being automatically displayed in this circumstance? thanks, jigar -- Posted via http://www.ruby-forum.com/.
2006 Jul 21
9
multi-server rails deployment
I''m building an app in rails that will be deployed on 3 different servers but am not sure the best way to deploy it. The app is something like Google Adwords (an online advertising program, essentially). ServerA is the Administration server ServerB is the Ad server (feeds ad requests to affiliates) ServerC is the Click server (handles incoming clicks from our affiliate sites) All 3
2006 Jul 25
12
DRYing - similar named fields, etc.
I''m sorry - just couldn''t come up with a subject that describes the problem :( Anyway, this is my problem. I have a long list of fields that need to be displayed when a ''show'' is requested on the controller. I''m now doing the list.rhtml and looking for a DRY way to do the following. For each data item, I have 2 fields - one is the item name, the
2006 Feb 07
17
Easy way of dealing with nil properties in templates?
Is there an easy way to deal with nil properties in templates? All I''m aware of are these methods, and it''s quite tedious and surely violates DRY. <%= @member.name unless @member.name.nil? %> <%= @member.name.to_is %> <%= "#{@member.name}" %> csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the
2006 Apr 25
2
Bug in Rails 1.1 implementation of before_filters
I just spent a few hours tracking down a bug in Rails 1.1, so I thought I''d post the issue and a workaround just in case anyone else hits it. I designed a security enhancement so that controller methods can be protected by preceding them with a role. The standard Ruby method_added() callback is used to detect when controller methods are added, and then I manipulate the
2007 Jun 27
5
Filter Ordering in Edge Rails (Rev 7143)
Filter chaining appears to behave in differently than Rails 1.2.x. It seems that I''m getting a lot of errors along the lines of: ActionController::ActionControllerError: filter #<ActionController::Filters::ClassMethods::BeforeFilterProxy:0x322f468 @filter=#<ActionController::Filters::ClassMethods::SymbolFilter: 0x322f4b8 @filter=:login_required>> was in the wrong place!
2006 Jun 24
3
Performance vs normalization best practice
I have a common situation and would like best practice suggestions from some of you more experienced rails developers. In my DB I''ve normalized tables in a traditional manner, e.g. I have Posts which have authors stored in a Users table. My problem is when I go to show a list of Posts and I want to display the author name (e.g. post.author.name) ActiveRecord appears to do a SELECT
2009 Apr 13
1
should sub(perl=TRUE) also handle \E in replacement, to complement \U and \L?
Currently sub(perl=TRUE) allows you to specify \U and \L in the replacement argument so that the rest of the subpatterns in the line (the \\<digit> things) will be converted to upper or lower case, respectively. perl also also has a \E operator to end these case conversions for the rest of the subpatterns (so they retain whatever case they had in the original text). For symmetry's sake
2006 Feb 07
2
Checking for nil in views
Hello, Is there a better way to do the following in a view? <td>Manufacturer <td><%= @equipment.manufacturer.name unless @equipment.manufacturer.nil? %> -- Posted via http://www.ruby-forum.com/.
2006 Jan 04
7
<% if ... -%> What is this?
I seen some RoR code that went like this: <% if ...blah, blah... -%> .. blah, blah <% end -%> What are the minus signs for in the if statement? Cannot seem to find anything about this, and searching on "-" in this context is hard to get anything meaningfull back. Thanks, - Mark -- Posted via http://www.ruby-forum.com/.
2006 Jan 13
4
Flash not cleared with ActiveRecord session store
Cheers, I''ve stumbled over a bug with 1.0 and ActiveRecord store for session while migrating from pstore sessions. I created the table with `rake create_sessions_table` and set `config.action_controller.session_store = :active_record_store` in environment.rb. Everything runs fine except that the flash messages will not be cleared. I get the same message everytime on everypage I
2006 Jan 14
3
How to render from a different controller
My code is something like this. class FirstController < ApplicationController def foo #some processing render (:controller => ''second'', :action => ''index'') end end I tried using both render and redirect but it seems it''s not possible to send the control from within a controller to some other controller. Am I missing something
2006 Jul 13
3
Performance diff between rendering partial vs. calling a helper?
Hi, Is there any performance difference between rendering partials vs. calling a helper? When we initally started coding we built a bunch of small partials and if there is a significant performance overhead with them, we''ll probably try to switch them over to helpers. They seem like they would be quite similar but I don''t know the full details of how partials are handled.
2006 Feb 05
30
Emacs rails.el
Features: * Management WEBrick - start, stop * Viewing log files * Abbrev from TextMate * Switching between View/Action http://www.emacswiki.org/cgi-bin/emacs/rails.el
2005 Dec 30
6
call a method once per page request
Hi, I''m wondering if there is a simple solution to call a method once per page request. I tried to place my call in a before_filter in ApplicationController but it''d called a second time if I use render_component from a view. Seems to me that a hook should be added in Dispatcher#prepare_application. Context: working on i18n, I''m trying to check lang either from uri,
2006 Jan 23
6
Code coverage tools in Ruby?
Can anyone help me find a code coverage tool in ruby? What I want is: given a set of tests that I run, what lines of my code and what routines are covered. And also a list of uncovered routines and tests. I couldn''t find an open source one out there... -- www.kenlet.com
2006 Jan 04
7
variables in layouts
I have a layout that provides the basic outline of each page in my app. It has a title, footer and a navigation bar. In the title I want to put the name of the current user that is logged in. I could do something like @session[:username] but I would rather encapsulate that into a single variable so that I can change the key in the session map if I want without having to goto each page that