similar to: How to set a controller''s layout?

Displaying 20 results from an estimated 8000 matches similar to: "How to set a controller''s layout?"

2007 Sep 21
3
merb 0.4.0 - redirect problems
I had redirects working just the other day... before I upgraded to the latest release. Can somebody please chime in as to why this simple redirect is throwing an error? Controller: ----------------------- def do redirect "http://www.ebay.com" end Error Output: ------------------------- Internal server error 500 uninitialized constant Merb::ControllerMixin::MovedTemporarily in
2007 Mar 12
5
Clarification of how controllers and views work together...
Hi, So I''ve started mucking about with Merb. I''m doing some experimenting with some product ideas. Things are working out quite well, Merb is a pleasure to use. It seems very fast too. A couple of rough spots but that might be me, if they are still chaffing after a few more days I''ll mention them. One thing... I wrote a controller and a view with several
2007 Nov 06
2
what did I do?
I''m following merb trunk. This morning I updated my gems, sync''d merb source and installed the merb gem from source. I don''t know if I did something wrong, or if a new gem messed things up, or if there was a merb change which broke something. Now I get this error: Request: REQUEST_URI: / (2007-11-05 20:27:04) Params: {"action"=>"index",
2007 Sep 04
11
returning(...) ?
The following construct is an ActiveSupport-ism: returning(Foo.new) do |foo| ... end I don''t especially like it, since it''s both more verbose and less efficient than the direct alternative: foo = Foo.new ... foo It doesn''t occur many times in Merb, so does anyone agree with me that it should be removed? I tried doing this (patch attached) and I find
2007 Sep 04
1
Couple of questions for Merb 0.4
All, I have just updated to the latest release of merb 0.4 and I am wondering how I can get my controller changes to reload without bouncing the server ? I am running in dev mode but my changes to my merb controller don''t seem to get picked up on new requests. Also say I have a controller that needs to render an alternate xml format ie something like:
2007 Dec 13
1
Merb::RenderMixin#set_status refers to non-existent RESPONSE_CODES constant
#set_status http://merb.devjavu.com/browser/trunk/lib/merb/mixins/render.rb#L270 refers to a non-existent constant. I tried, while creating #359, to make things OK, but I failed. I started by using STATUS_CODES instead, then used #[] instead of calling a method named STATUS_CODES, then I found out that during the call to #inherited
2008 Mar 18
1
Merb and Javascript template system
I''ve tryed to use the same logic in html layouts to handle javascript files without success. All I need is not repeat javascript code in various erb templates that have 90% of identical code. - I can''t use more than 1 js file. - If isn''t a way to do this like erb can do in html, what''s the best way to "include" a file in another using Merb? -- from
2007 Dec 12
3
merbful_authentication
Since there are so many efforts at the moment to port restful_authentication I figured I''d put a repo up so that it can be a collaborative effort. You can pick up a copy of the repo at git clone http://snatcht.com/git/merbful_authentication.git at the moment the app is in a branch. Not in the master. get the branch by git checkout -b remote/initial origin/inital_repo At the moment
2006 Dec 07
3
What does js partial(...) do?
In the example application named "sample_app", comment.jerb contains the following line: $(''comments'').update(<%=js partial(:comments) %>); What does the ''js'' method do to/with, if anything at all, ''partial(:comments)''? Merb is quite fun to use and I''m starting to get a feel for it and ruby. I''m surprised at
2007 Sep 29
1
templates with same name before extension are cached
Hi all, I was just wondering if this is the intended behavior. Here is my setup: controller def index respond_to do |f| f.xml { render :xml => true } f.html { render :layout => :none } end end In my views I have a file for each type index.herb index.xerb The first request I send is cached and interferes with the other one. For example, if I send an xml request
2009 Oct 22
4
spec failing to run specs when spec.opts is present on 1.2.9
Hi I ran across the following when running spec on an old merb app. $ cat spec/spec.opts $ spec spec/models/topic_spec.rb Options written to spec/spec.opts. You can now use these options with: spec --options spec/spec.opts $ cat spec/spec.opts spec/models/topic_spec.rb $ spec spec/models/topic_spec.rb Options written to spec/spec.opts. You can now use these options with: spec --options
2007 Sep 11
4
Problem returning a Proc
I''m just playing with a recent Merb trunk (-r590). All the specs pass, apart from 2 pending. Now, the README says: "if you return a Proc object from your action, it will be called and the return value sent to the client." However this doesn''t seem to work with the following test controller: class Hello < Application def world res = "Hello world from
2008 Jan 18
5
How do I pass form values from POST controller specs?
Hi there I just started my first Merb app and I''m running into some weird things in Specs. When I do: describe "create action" do it "should create a new project" do project_params = {:name => ''bekkunin''} Project.should_receive(:create).with(project_params) controller, action = post(''/projects'', :project
2007 Jul 31
2
controller exceptions
Since Merb has the lovely property of rendering the output of an action, using ruby-level exceptions to render error pages in Merb could be a cute way to approach error handling. Suppose one has an action for editing a product which you would like to restrict to administrators: def edit raise AdminAccessReqired unless session[:user] and session[:user].admin? @product =
2008 Jan 16
3
Application generation
Hi All, Is anyone seeing this? $ merb merb_paste /usr/local/lib/ruby/gems/1.8/gems/merb-0.5.2/lib/merb/config.rb:69:in `parse_args'': uninitialized constant Merb::RELEASE (NameError) from /usr/local/lib/ruby/1.8/optparse.rb:785:in `initialize'' from /usr/local/lib/ruby/gems/1.8/gems/merb-0.5.2/lib/merb/config.rb:67:in `new'' from
2006 Dec 04
2
Merb on Win32 Platform
I''m trying to get Merb running on Windows XP SP2 and am experiencing some difficulties. I load http://localhost:4000/posts/new in my browser expecting to see the contents of new.herb rendered. However the following error is reported: Request: PATH_INFO: /posts/new Params: {"action"=>"new", "id"=>nil, "controller"=>"posts"}
2007 Aug 31
3
Bootstrapping from SVN
Is there a simple way to bootstrap merb directly from the Subversion repository, rather than first installing it as a gem? I can do the following if I already have an old gem lying around: merb -g testapp # using an old gem cd testapp rake merb:freeze_from_svn Unfortunately, that means I''m using an old version of the generator. So for example, when I just tried this,
2007 Feb 15
1
wrong startup information in production environment
Hi, I check out the last codes from merb repository. And the startup information for production environment just like that: ====================================================== dev:/var/www/apps/upload_merb/current/log# /etc/init.d/merb_init start Merb started with these options: --- :template_ext: :html: :herb :js: :jerb :xml: :xerb :config: dist/conf/upload.conf :drb_server_port:
2007 Nov 07
1
merb/sequel mutex on or off? proxy_balancer or no?
Just a quick question to those of you using merb and sequel or datamapper. How do you setup your merb app? For example: merb -X off -c 5, then run mod_proxy_balancer or nginx to load balance between the 5 (or whatever #) of merb nodes? merb -X off -d, then simply use something like proxypass merb -c 5, keep the mutex lock and cluster it haproxy, swiftiply, evented mongrel...... What
2007 Nov 07
2
merb 0.4.0 session issue
Not sure if anyone else has had this problem. I was running on merb edge fine a few days ago. Last night I went to merb 0.4.0 via gem install and now any call to session[:foo] causes an error >> undefined method ''[]'' for nil:NilClass I have uninstalled and reinstalled merb with no luck. dependencies.rb use_orm :activerecord merb.yml :session_store: active_record Gems