search for: maincontrol

Displaying 20 results from an estimated 24 matches for "maincontrol".

Did you mean: mailcontrol
2006 Apr 25
7
Rails producing the / page.
Hi all Very simple question, im sure, but I cant find docs anywhere that tell me how to do this. What I want is for the index page of the server to be generated from rails, is www.wibble.com/ will result in a page that has been processed by rails, has the templates etc. >From what I can see, the index page comes from public/index.html How do I get this to be a rails page? Thanks Jonathan
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 all files in lib/. But in this case it does not wor...
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 ''certified'' within a table called objects. The certified field contains an ''int'' of either 0 or 1 - these will become Y/N checkboxes. Within...
2008 Mar 04
9
What is your workflow? Or how to use the story runner the right way.
I really would like to know how people are using the Story and Example runner to write their software.It would be great to get some direction on it, because I think I''m missing some points. Taking the outside-in approach in thought: At first we write a high-level customer-facing story, this story fails. Then we start using mocks at object level to use them as a design tool, and so we
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_helpe...
2006 Jun 18
2
Why can''t I use a session? (Symbol as array index)
...:Base model :mything def ApplicationController.chosen_thing session[:chosen_thing] ||= MyThing.defaultThing end end So whenever I try to access ApplicationController.mything in one of the controller subclasses I get the error below. Any help much appreciated. Donald TypeError in MainController#index Symbol as array index RAILS_ROOT: /Rails/foo/public/../config/.. Application Trace | Framework Trace | Full Trace #{RAILS_ROOT}/app/controllers/application.rb:10:in `[]'' #{RAILS_ROOT}/app/controllers/application.rb:10:in `compute'' #{RAILS_ROOT}/app/controllers/main_cont...
2006 Aug 01
8
Dumb views?
Hello again! I''ve another "what would you do in this situation" question. You''ve got 6 controllers, one named base. The other 5 controllers extend base. Currently they share one layout. Your layout displays navigation. However, there are two actions inside base for which you do not want navigation displayed (index, new). Do you... a) Add logic to your layout telling
2012 Jan 04
1
render :update problem with IE 9
...t;, :kind => "even"), :remote => true) %> <div id="list_of_numbers"><%= render :partial => "odd" %><div> On the server side I see this: Started GET "/change?kind=odd" for 10.0.8.9 at Wed Jan 04 11:10:59 +0100 2012 Processing by MainController#change as HTML Parameters: {"kind"=>"odd"} Completed 406 Not Acceptable in 0ms And the IE 9 says quite the same. Any ideas why this doesn''t work with IE9? Thank you in advance! Sincerely, Zsolt -- http://zsoltfabok.com/blog -- You received this message beca...
2006 Apr 27
5
ERb on he command line re: Ruby For Rails book
Hi, I am working thru the Ruby for rails book. On page 30 David Black talks about running erb from the command line i.e. $ erb erbdemo.rb just as you would a normal ruby prog ($ ruby erbdemo.rb) but when I try to do this I get command not found. How do I make this work? I am running Linux (Ubuntu Breezy) Regards, Paul
2006 Aug 15
0
Benchmarking not being included?
...her apps I have deployed with rails 1.1 have production logs that look something like this: Rendering main/index Completed in 0.06379 (15 reqs/sec) | Rendering: 0.02569 (40%) | DB: 0.02510 (39%) | 200 OK [http://demo.test-server.tv/] Instead, what I''m seeing looks like this: Processing MainController#index (for 74.65.211.200 at 2006-08-15 18:30:54) [GET] Session ID: a6f5b83d402a394e0369f876470b4319 Parameters: {"action"=>"index", "controller"=>"main"} Rendering within layouts/main Rendering main/index As near as I can tell, the line I want...
2006 Jun 24
0
Theme generator
Hello, I just downloaded the Theme Generator, I set it up and put, theme ''main'' then I got "undefined method `theme'' for MainController:Class" but, in the readme it dosn''t say to require it or anything what do I do? -- Posted via http://www.ruby-forum.com/.
2006 Mar 22
3
stack level too deep error : Pulling my hairs out
...ising 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'' app/main_controller.rb (nothing else in this file) class MainController < ApplicationController layout "common" def index end end views/main/index.rhtml (nothing else in this file) <b>I''m here</b> This is really frustrating, the development.log file contains thousands of /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib...
2006 Jan 04
0
Simple print statement (was: recongizing the current controller in views)
...cs; However when putting this in a controller: @test1 = controller_class_name @test2 = controller_name @test3 = controller_path And this in a partial: Test1 <%= @test1 %><br/> Test2 <%= @test2 %><br/> Test3 <%= @test3 %><br/> I get this in my browser: Test1 MainController Test2 main On the third one I get a: undefined local variable or method `controller_path'' Is there a difference with the 1st and 2nd? Is this a faulty application to do so? Thanx! Gerard. On Wednesday 04 January 2006 18:58, Kevin Olbrich tried to type something like: > Gerard...
2007 Jan 01
0
Simple question on inserting child data
...can''t figure out how to insert the post_id value into the reply table. When creating a reply the user is directed to a page via a url simular to the following http://localhost:3000/main/reply/4, with the value 4 being the post_id that is being replied to. In the controller I have: class MainController < ApplicationController def index #display a list of the posts @posts = Post.find(:all, :order => "id desc") end def reply #display the post that is being replied to @post = Post.find(params[:id]) @reply = Reply.new end def post_reply @reply =...
2008 Jul 22
0
Routes dependent on subdomain
...s, pointing to the same server/app. For example: mainserver.com user1.mainserver.com user2.mainserver.com I want to have exactly the same app and exactly the same routes on all, except that I want to map root of mainserver.com to different controller than other. For example: mainserver.com => MainController user1.mainserver.com => UserController user2.mainserver.com => UserController Any ideas how can I do it using Rails routes? Or possibly URL rewrite in Apache proxy? I am also considering different approach - I will have 2 applications running, and share part of code (models, some base c...
2008 Aug 20
0
Re: Help with RoR partial views
...;Heh--"it gives me an error" covers a lot of ground. ;-) Yes your right, and i am sorry for that, my message was a little ambiguous. I have changed the main_controller.rb and i''ve added the instance variable has you said. It now looks like this main_controller.rb [code] class MainController < ApplicationController def welcome @product = Product.new end end [/code] There is no error now, the partial is rendered. But now i have another question. When i press the "Create" button on the form, all of the output is redirected back to the products view. I want the er...
2008 Nov 11
0
can't figure out this error message please help
...rd.edu (view the source code to see the extra "error page" tacked onto the end of my own data.) there are no errors being reported in my production log (pasted below). this is really confusing, please help! thanks. **** # Logfile created on Mon Nov 10 19:03:03 -0800 2008 Processing MainController#index (for 76.221.200.45 at 2008-11-10 19:03:09) [GET] Session ID: BAh7BzoMY3NyZl9pZCIlZWQ1MDgzYmJlMmQwYjRmZDdmNTYyYTQ1MTYyMGZk NDEiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh c2h7AAY6CkB1c2VkewA=--e4964e10d45a49ec4d5a2548622f4375f44b24ce Parameters: {"action"=>&quo...
2010 Nov 01
1
Encoding::UndefinedConversionError on a simple file upload (rvm, MRI-1.9.2-p0, rails 3.0.1, apache+passenger)
Hello everyone. I am having the encoding issue on a simple file upload action: Encoding::UndefinedConversionError in MainController#upload "\xC4" from ASCII-8BIT to UTF-8 The action looks like this: def upload @uploaded_io = params[:upload] File.open(Rails.root.join(''public'', ''images'', @uploaded_io.original_filename), ''w'') do |file| file.write(@...
2006 Jun 09
3
routes & methods in controllers
...bie in rails so bear with me on this one new test app.... rails test generate controller main i add a layout view for main/index & its working ok i set the routes as follows map.connect '''', :controller => "Main" the above is the only route thats active in the MainController i add in a new method "about" with a simple render_text "hello" in it refresh the page & i get this error No url can be generated for the hash {:action=>"about", :controller=>"Main"} I thought that since the default route is now going to main,...
2009 May 19
3
SSL testing on localhost - segfaults aplenty !
Hello, I''ve followed the tutorial @ http://weeatbricks.com/2007/10/31/how-to-use-a-rails-app-with-https/ to setup SSL on localhost, wanting to use https for logging in and such. Using the method described above I get sensibly higher load times and of course very very frequent and random segfaults (be it ActiveRecord, Mongrel or any other .rb causing it) !! Platform is..well Win32.