similar to: class level "static" code in controller object not working

Displaying 20 results from an estimated 10000 matches similar to: "class level "static" code in controller object not working"

2006 Apr 13
4
Apache/fastcgi setup can''t find custom config/*.yml file!
All, Apache 2/FastCGI on Linux My fastcgi config. file is set up to run the "test" RAILS_ENV. When I go to access a view associated with a particular controller, I keep getting a ENOENT (file not found) error on a custom config. file that I am attempting to load. What I can''t figure out is why it can''t find the file. Here''s the code that loads it in my
2008 Jan 11
26
Mongrel doesn''t start under Rails 2.0.2/Win XP
All, Mongrel 1.1.3 Rails 2.0.2 Ruby 1.8.6 Windows XP SP2 When I issue the command "ruby script/server" from any of my Rails projects on v. 2.0.2, I get a Windows dialog with the error: "The application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem." I''ve gone through the process of attempting to introduce
2006 Mar 21
3
Do module source code changes require reboot of WEBrick?
Assume that I refactor some code into a module and "require it into" my controller. Do I then need to restart my WEBrick server each time that I change the module? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Mar 27
3
Specify a controller action via attribute in INPUT tag?
I have a pre-existing form with one existing "SUBMIT" tag generated by <%= submit_tag %> I would like to add another <INPUT type="submit" ...> to my form. How do I successfully associate that <INPUT> tag with a different controller action than the default one specified by my <%= start_form_tag %>? Or does this approach even make sense? In RoR, is
2006 Mar 20
8
Best way to organize non-controller logic???
I don''t want to put certain code in my controller because I think it makes things more confusing. What is the best way to manage business logic such that it doesn''t end up in the controller? Basically, where should I put my regular utility classes and backing objects that may not be models? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All, I''m having a hell of a time figuring out what is going on here. I''m trying to override one of my getters so that I can format it a certain way in my form. But I can''t seem to get text_field to call the appropriate method on my object. So here''s my getter: public def FAX fax = read_attribute(:FAX) puts fax
2006 Mar 14
4
What does the send() method do on a model object?
All, I did a scaffold for a model and I ended up with this code in list.rhtml: <% for column in TargetList.content_columns %> <td><%=h target_list.send(column.name) %></td> <% end %> Where is the "send" method and what does it do? I can''t find it on ActiveRecord::Base? I assume that it returns a value based on the column id but I
2006 Apr 26
2
Routing to a static HTML file under RAILS_ROOT
I have a regular plain old static HTML file under my RAILS_ROOT that I would like to serve as itself (without any dynamic anything). How can I write a route to "pass the request through" succesfully. I tried map.connect ''path_to_file'', :controller => nil, :action => nil, :id => nil but that didn''t work. Also, note that I have this route
2006 Mar 18
9
Using <%= text_field %> within partials is problematic
All, Thanks for any help in advance. I have what I think is a very straightforward partial template and I can''t figure out why a text_field call within it doesn''t work. Here is my calling template: lists.rhtml <div id="target_lists"> <%= render(:partial => "target_lists", :collection => @target_lists) %> </div> In the partial
2006 Jul 03
2
1.1.4: link_to with mixed case controller names "broken"?
I have a side navigation bar with links embedded in it like the following: <%= link_to( ''Create Job'', { :controller => ''eSimply'', :action => ''upload'' }) %> This link now shows a routing exception Recognition failed for "/eSimply/upload" This link has worked for over through Rails
2006 Apr 12
2
IO.read fails on relative path in model object
All, I am attempting to do an IO.read call on a file inside of one of my model objects. I keep getting Errno::ENOENT The path I''m passing to IO.read is relative to RAILS_ROOT. Two questions: 1) This code was previously executing in my controller - it it significant that I moved it into my model? 2) Is there some way to verify which directory is the current directory for the
2006 May 30
5
Implementing HTTPS with WEBrick?
All, I would like to test some secure pages that I''m developing in my WEBrick-based development environment. I''ve done some research and it appears that I need to create a new command that will start a HTTPS based WEBrick server. Is this correct? Also, it appears that the https.rb module is not included with the WEBrick bundled in Rails. So, I will need to go get that
2006 May 18
2
Utility to translate HTML character entities into text?
Anyone know of a Ruby utility that will translate HTML character entities into text? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Jul 10
8
Setup new data in the test database _after_ unit test runs
All, I want to run automated unit tests as part of my build. I am building to my test environment. Upon successful completion of all of my unit tests, I would then like to load some data (using a fixture, I imagine) into my test database that will act as fresh "system test" data for my users to play with. What is the best way to "load the standard system test/user acceptance
2008 Mar 14
15
Is anyone running Rails 2.x against a MS SQL Server DB?
I am unable to get ActiveRecord session support to work under 2.x against a SQL Server database. I''m starting to wonder if anyone is running 2.x against SQL Server? Is anyone running under the following configuration: Rails 2.x SQL Server 2000 DB (using AR adapter in ODBC mode) AR store for ActionController session store. I''d like to chat with you if you are. Thanks, Wes --
2006 Jul 13
5
Generic page element display initializer in a layout?
All, I''ve run into a snag. I need to handle the display of elements on my page and I want to use my Javascript event handlers on page load. However, my BODY tag is trapped in my generic layout. I''m thinking that I can put an onLoad on the BODY tag that will just call a Javascript method called initializePage() and then provide this initializePage() call in my specific page
2006 Jun 27
5
Can''t call public application.rb method from ERb template
All, I have a left navigation partial that I want to dynamically generate CSS classes for based on the current controller action. In my ERb template, I have <DIV class="<%= get_menu_display_style(''login_form'') %>"> In application.rb, I have the method get_menu_display_style defined as: public def get_menu_display_style(action_requested)
2006 Mar 22
6
Relatively easy HTML/XML parsing utilities?
Anyone know of any Ruby modules which can be used to parse an HTML page ? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
All, In a template, I have <%= text_field :target_list, :DateReceived, { :title => ''uploaded_at'', :class => ''target_list_info'', :disabled => ''true'' } %> Here is the DateReceived method on my
2006 Mar 22
2
RubyGem loading into a controller (High quality question)
INSTALLATION: Ruby 1.8.2 Rails 1.0.0 rubyful_soup 1.0.4 (GEM) FACTS: 0) I have successfully installed the rubyful_soup GEM using (I had previously installed it, which is why the output may look sparse): C:\ruby>gem install -r rubyful_soup Attempting remote installation of ''rubyful_soup'' Successfully installed rubyful_soup-1.0.4 Installing RDoc documentation for