similar to: Render a view from console

Displaying 20 results from an estimated 10000 matches similar to: "Render a view from console"

2007 Jul 06
3
stubbing helper methods for View specs
Hi there I have several view specs, that include the following snippet in their "before" block to stub the methods by acts_as_authenticated before :each do @u = mock_model(User) @u.should_receive(:name).and_return("Hans Muster") template.should_receive(:logged_in?).and_return(true) template.should_receive(:current_user).and_return(@u) end this
2006 Jul 14
7
Using ActionView free style
ActionView is a very useful class, in its own right. But, calling it by itself causes a weird crash, exiting Ruby, without even raising an exception! ruby script/runner "begin; av = ActionView::Base.new; av.render(:inline => ''Hi!''); rescue => e; puts e; end" just crashes Ruby. Same with render(:file => ''template.rhtml'') Why is this?
2010 Apr 10
5
Rendering a Partial as an Alternative
Suppose that I want to have a block of default content within a template that is replaced with the content of a specific partial only if that partial exists. Obviously there is the brute force approach of simply rendering the default content unless the relevant partial file exists in which case the relevant partial is rendered instead. I suspect that there may be a more elegant way to skin this
2012 Nov 27
1
controller not rendering existing js.erb file
In my PlaceController, I have a search method, called remotely from a form the method is executed, but rendering is not executed as the template is stated as missing .. but it''s there ... post :search, :locale => I18n.locale, :format => :js, :country => "United" Error: test_should_search_places(Backoffice::PlacesControllerTest) ActionView::MissingTemplate:
2012 Sep 23
6
Missing template projects/index, application/index ?
Getting this issue...even though I have my views there in both the projects and application. Also getting a routes issue "No route matches [GET] "/projects" when going to projects when I have root :to => "projects#index" defined in my routes file. Any idea? 1) Creating Projects can create a project Failure/Error: visit ''/''
2011 Nov 24
2
This is not the error: ActionView::MissingTemplate
Hey everyone, I am getting the following error: Started POST "/rubyamf/gateway" for 127.0.0.1 at 2011-11-24 16:27:20 +1300 Processing by RubyamfController#gateway as */* Processing by ProjectsController#templates as */* ←[1m←[36mProject Load (1.0ms)←[0m ←[1mSELECT `projects`.* FROM `projects` ←[0 m Completed 200 OK in 34ms (Views: 3.0ms | ActiveRecord: 28.0ms) Completed 500
2009 Apr 03
7
RJS not rendering correctly when mime-type is 'iphone'
I have an iPhone version of my site, and for some reason none of the rjs works when viewing the iPhone version. This happens instead: ActionView::MissingTemplate (Missing template controller_name/ update.erb in view path app/views) The rjs works fine when viewing the site normally, and it worked when viewing the iPhone version prior to upgrading Rails to 2.3.2. Additional info: I have
2008 Dec 08
2
undefined method 'render_file' for class 'ActionView::Base'
I need some help with SimpleLog I have SimpleLog running at HostingRails. I want to develope and test new themes stuff on my local system. I getting the error from actionview_ex.rb:12 undefined method ''render_file'' for class ''ActionView::Base'' I am at: Ruby: 1.8.6 Rails 2.2.2 gem: 1.3.1 rake: 0.8.3 I am a new rails/merb/ruby developer. I think I am on the
2005 Dec 11
7
Catching Exceptions in ActionController
I''d like to be able to catch ActionController::MissingTemplate exceptions from within ActionControlle, *but*, MissingTemplate isn''t defined within my controllers!!! How is that possible - after all, all controller subclass ActionController, so how are exceptions it defines not there!? More importantly, how can I do this? -- Posted via http://www.ruby-forum.com/.
2006 Oct 17
4
Mocking the rendering of a Rails template
Hello all, I''m having difficulty setting up mocks such that I can verify that Rails was going to render the right template file (for example new.rhtml) and stop Rails from performing the actual rendering. After peeking at Rails'' internals, I tried two techniques as illustrated here: http://pastie.caboo.se/18197 Neither worked. I think the first one failed because Rails
2008 Dec 17
9
Rails 2.2.2 and globalize - undefined method `render_file' for class `ActionView::Base' (NameError)
Looks like globalize (1.2) is not compatible with rails 2.2.2. I am getting: '' => Booting Mongrel (use ''script/server webrick'' to force WEBrick) => Rails 2.2.2 application starting on http://0.0.0.0:3003 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3003 ** Starting Rails with development environment...
2010 Jan 25
1
ActionMailer does not find templates in production mode
Hello everyone, I am currently struggling with the following issue that only seems to appear in my production environment: When attempting to send a mail from an ActionMailer the template location algorithm does not seem to pick up the corresponding template: ActionView::MissingTemplate (Missing template event_mailer/approval_requested_notification.erb in view path app/views):
2009 Jun 11
4
Using view helpers and route helpers in a model
Hi there, I am trying to get something working and its driving me crazy. I have been looking around for solutions to getting view helpers working in models and for the most part I find this solution. Add the following in the model you want to use them in include ActionView::Helpers::UrlHelper include ActionController::UrlWriter However, when I try something like
2010 Mar 25
0
Rails 3.0 + haml render partial ActionView::MissingTemplate
I''m upgrading one of my apps to rails 3.0 I get this error: ActionView::MissingTemplate Missing partial /layouts/header with {:formats=>nil} in view path for: = render :partial => "layouts/header" the file is in views/layouts/header. From the error message, it looks like it appends an absolute path: "/ layouts/header" Anyone has seem this problem when
2006 Aug 01
2
actionmailer cant find template in backgroundrb
Im trying to send mails from a backgroundrb worker and it seems like ActionView cant find my template. same code works as a rake task. here my worker: class StatusMailWorker < BackgrounDRb::Rails repeat 1.minutes # <-- hehe! def do_work(args) [...blah...] NotificationMailer.create_daily_report(users, rep, items) end end end its throwing the following error: No
2011 Jan 15
3
respond_with javascript
My ajax stopped working when I switched to using respond_with. For my Votes, I have the create action and the corresponding create.js.erb, and respond_to :html, :js, :xml in the controller. Heres the log when I try and create a vote: Started POST "/stories/3-asdfasdf1111/votes" for 127.0.0.1 at Fri Jan 14 20:46:36 -0800 2011 Processing by VotesController#create as */* Parameters:
2008 Mar 24
2
render not able to locate template in publisher
Hi guys, I have a publisher called UserPublisher setup in models directory of my app. The reason I have it in a model is because its then possible for me to invoke publisher methods in after_callbacks of my other models, just the way we do it for ActionMailer. My problem is that when I try to update a users profile specifying location of the view template as a paramater to "profile"
2005 Apr 13
2
multinom and contrasts
Hi, I found that using different contrasts (e.g. contr.helmert vs. contr.treatment) will generate different fitted probabilities from multinomial logistic regression using multinom(); while the fitted probabilities from binary logistic regression seem to be the same. Why is that? and for multinomial logisitc regression, what contrast should be used? I guess it's helmert? here is an example
2002 Dec 01
1
generating contrast names
Dear R-devel list members, I'd like to suggest a more flexible procedure for generating contrast names. I apologise for a relatively long message -- I want my proposal to be clear. I've never liked the current approach. For example, the names generated by contr.treatment paste factor to level names with no separation between the two; contr.sum simply numbers contrasts (I recall an
2012 May 28
1
rendering a partial inside another using render_to_string and (:formats) in controller
I want to clean my code by moving the duplicated lines : partial = render_to_string( :partial => "#{file}", :formats => [:html] ) to the pagination_partials function. ================================================= WORKING CODE: ================================================= def render_format_search_partial(file, options={}) # TODO remove this line to use the one