similar to: Making methods in application.rb not accessible to the web?

Displaying 20 results from an estimated 60000 matches similar to: "Making methods in application.rb not accessible to the web?"

2006 Jul 22
4
Accessing the controller name in your views?
I need to know what controller and action the user is currently in to do various things in my layouts/application.rhtml file. Isn''t there is a better way than: <% if params[:controller] == "whatever" && params[:action] == "whatever" %>some html<% end %> I know in the controllers you can just use controller_name, but that is not provided
2006 Aug 02
7
ActiveRecord does not close database connections?
I have an application that creates quite a few threads. I keep getting the "mysql too many connections" error. ActiveRecord does not close the connection once a thread had died out. To make things worse mysql has a wait_timeout variable that would basically kill off these connections for me, but there is a bug and I can not change the value of it. I have tried at least 10 different
2006 Aug 18
3
Mysql::Error: Can''t create UNIX socket (24)
Any idea what this means? I have done many google searches and got nothing? Any help is greatly appreciated. -- Posted via http://www.ruby-forum.com/.
2006 Jun 21
2
access to application.rb methods
Why can''t I access the utility methods defined in applicaion.rb from the model classes? If that does not work, where is the best place to put common utility methods that must be available to all the models. thanks -- Posted via http://www.ruby-forum.com/.
2006 Jan 03
1
RequireResourceHelper for JS and CSS
The following was posted on my blog at http://blog.inquirylabs.com. A friend of mine recently expressed interest in this code snippet, so I thought I''d send it out to anyone else who''s interested. This module makes it a lot easier to ''require'' javascript and cascading stylesheet dependencies inside your views or controllers. By
2011 Feb 21
2
self.prepend_view_path - am I missing something
I have an app that varies its content based upon the domain from which it is being accessed. Some of the domain characteristics are supported in the model but it is easier varying static text in the views and then sharing the form templates via partials etc. Rails 2.3.10 and looking at the documentation at
2006 Jul 26
6
Javascript tooltips in rails?
Does rails have built in functionality to do javascript tooltips? -- Posted via http://www.ruby-forum.com/.
2006 Jul 17
4
how to invoke model methods in controller & vice versa
hello how to invoke model methods in controller & vice versa please explain with examples advance thanx -- Posted via http://www.ruby-forum.com/.
2007 Mar 28
1
extracting common methods out of specs
I have several specs which do more or less the same thing: describe "GET /users/1/terms" do controller_name :terms def do_get get :index, :user_id => 1 end it "should be successful" do controller.should_render :index do_get end ... end How could I extract this functionality from each spec? Scott
2006 Apr 27
4
how to make views changable
Hello I need to make site views changeable I found how to change layouts but it is not enough, becouse templates can use different ways to display and organize content. I found one way to do this, but i need to make subfolders in my ''view/layouts'', ''view/controller_name'' both and to create additional subfolder somewhere in ''public'' to put
2009 Apr 18
0
A bug in sweeper.rb? [was: A frustrating and strange error when config.action_controller.perform_caching = true]
I fired up the debugger and watched the code happen tonight. The problem occurs if the config.action_controller.perform_caching = true in your environment. It''s not set to true in development but it is set to true in production and staging. The problem occurs not in my controllers but in sweeping.rb (part of rails). Rails calls this code for every controller which was instantiated in
2006 Aug 03
30
How to protect your code? Obfuscater?
I just made a rails application that I plan to sell and dsitribute. I want to distribute it without having to worry about someone stealing the code and selling their own version. How do I do this? Is there a ruby obfuscator or anything that can keep someone from seeing the code? Thanks for your help. -- Posted via http://www.ruby-forum.com/.
2006 Jul 22
3
How to use variables in your layout views?
Let''s say I wanted to find 3 products from my database and put them in the layouts/application.rhtml view. Where do I find these 3 products? Do I just do it in application.rhtml? <% for product in Product.find(:all, :limit => 3) %> Because I was under the impression that you really don''t want to do this in your views. You should do this in your controllers and
2007 Dec 12
3
undefined method: controller_name
With rspec 1.0.8 I have a spec in the directory: spec/units/controllers/application_controller_spec.rb require File.dirname(__FILE__) + ''/../../spec_helper'' class DummyController < ApplicationController def index raise "Prevent index from rendering" end end describe ApplicationController, "Handling errors in production", :behaviour_type =>
2006 Aug 12
9
Finding the closest match?
I am trying to do a search for a crazy problem. Anyways, the search can only contain one word and the database it''s searching contains one word per row. Basically if someone tries to search for a word I want to find the closest match. Ex: If someone types "cat" and "cat" is not in my database, but "bat" is, how could I select bat? Also, if someone
2009 Jul 02
7
Params Merge and URL sorting/pagination
Hi all, Here''s my general setup on the specific template I''m having issues with: will_paginate for pagination custom methods for sorting 1-form for team search 1-form for search by date When searching for a team for instance, the url returned will be: /rushing_offenses?search=Florida When searching by date, the url returned will be: /rushing_offenses?compiled_on=2009-07-02
2007 May 14
1
[ADV] New book: The Accessible Web
Gentle Web Development Folk: Just in time for RailsConf, I''m happy to announce Jeremy Sydik''s book, "The Accessible Web", is now available in beta. This is particularly sweet as Jeremy and I first discussed this book in the hallways of last year''s conference. This book is all about making your website accessible web sites-- sites that can easily be used
2006 Jul 10
3
how to access a model from application.rb
Hi All How do I access a model from within the application.rb? What im tying to do is pull some data from a model (news in this case) that must be displayed on each page within the entire application. I know I could drop this into each controller, have each view pull it from the controller, but thats repeating myself... So whats the best way to do this (as I dont think models are visible
2006 Jul 09
1
Accessing the name of a controller''s module?
If I''m redirecting to a log in page, and saving the controller and action name in the session hash, how do I also save the controller module? After the log in is completed, I can''t redirect back to the originally directed page because it''s in a different controller module. For the controller action name I can use the ActionController instance method controller_name(),
2006 Jul 07
2
gem install mysql ***extconf.rb failed***
I''ve installed rails (and it works) and now I want to be able to connect to a mysql database. The database.yml file tells me to install the mysql drivers by typing: gem install mysql This is the error I receive: Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration