search for: view_context

Displaying 6 results from an estimated 6 matches for "view_context".

2008 Jan 03
3
Whats the merb equivilant of this?
Hey All Quick question, what''s the merb equivalent of this: ActionView::Base.new([template_root], assigns, self) in merb? Ive found Merb::Template::Erubis.transform(:file => ''/path/to/file'') But I''ve no idea if thats the correct thing to be calling? It doesn''t ''feel'' right, so im not sure it is? Thanks Tim
2010 Nov 04
0
Re: Train wreck getting render_to_string to work from foreign controller [SOLVED]
...# :api: plugin > def render_to_body(options = {}) > _process_options(options) > _render_template(options) > end > > # Find and renders a template based on the options given. > # :api: private > def _render_template(options) #:nodoc: > view_context.render(options) > end > > So I new to reading the source but is the problem that it is using the > view_context which I would assume would be that which the current controller > owns? That would seems to confirm the errors and ignorance of the controller > attribute. > >...
2007 Nov 06
2
what did I do?
.../git/rubyrubyroo/app/views/articles/index.html.haml:4 /Library/Ruby/Gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1863:in `method_missing'' /Library/Ruby/Gems/1.8/gems/merb-0.4.0/lib/merb/mixins/controller.rb:65:in `url'' /Library/Ruby/Gems/1.8/gems/merb-0.4.0/lib/merb/view_context.rb:73:in `send'' /Library/Ruby/Gems/1.8/gems/merb-0.4.0/lib/merb/view_context.rb:73:in `method_missing'' (eval):11:in `_render_haml_1'' (eval):8:in `each'' (eval):8:in `_render_haml_1'' /Library/Ruby/Gems/1.8/gems/haml-1.7.1/lib/haml/engine.rb:435:in `send...
2011 Apr 06
1
Time to fix PartialRenderer#partial_path
...with other code using your engine). module Foo class Engine < Rails::Engine; isolate_namespace Foo; end class ApplicationController < ActionController::Base; end class Thing < ActiveRecord::Base; end end Foo::Thing.connection.create_table(:foo_things) Foo::ApplicationController.new.view_context._partial_renderer.send(:partial_path, Foo::Thing.new) => "foo/foo/things/thing" I believe the solution should be to change the default behaviour or at least provide an option to stop rails from prefixing the partial_path. -- You received this message because you are subscribed to t...
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
2012 Apr 02
0
tinymce-rails-imageupload
...rails-imageupload Create name = params[:file].original_filename directory = "public/data" #create the file path path = File.join(directory, name) #write the file File.open(path, "wb") { |f| f.write(params[:file].read) } Render image: { url: view_context.image_url(image) } File is saved, but I do not know how to get the url ... thanks for the help. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/E...