similar to: Rendering a Partial as an Alternative

Displaying 20 results from an estimated 10000 matches similar to: "Rendering a Partial as an Alternative"

2010 Apr 13
5
How to check if a parent has children?
What is the new way to check if a parent has child items? In rails 1.2.6 I did this: if @client.has_line_items? Client being the parent and line_items the children. Now that I have upgraded to rails 2.0.1 (on my way to current :-) ) I am getting this message: undefined method `has_line_items?'' for #<Client:0x7f3b093b01a0> How should I format the query now? Regards, Paul
2010 Apr 09
9
gem install rails (Errno::ENOENT) No such file or directory
I have two PCs, one with Windows XP and another with Windows Vista. I''m working as an administrator in both computers. I''m using Ruby 1.8.7 and Rubygems 1.3.6. When I try to install Rails I get this error: C:\>gem install rails ERROR: While executing gem ... (Errno::ENOENT) No such file or directory - C:/Users/Jesús Dugarte I have installed Rails several times before
2010 May 03
7
rendering images dynamically
Hi, I have a rails application where I respond to a request by fetching image urls from various web api calls and need to display them as they come available. I am able to display all the images once I get them all, but that causes an unacceptable delay for my user. One approach I am trying is, from my controller, set an @image variable, and then pass in a block to the model that retrieves the
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 ''/''
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:
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 18
2
Render a view from console
Hello! In my application I''m trying to render a view from a class in /lib folder. I have found that it''s very similar to render a view from console. So, I have tried different methods: >> string = ActionView::Base.new.render( :inline => ''works'', :layout => false ) => "works" >> string = ActionView::Base.new.render( :template =>
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/.
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:
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):
2010 Jul 27
7
trouble with remote_form_for & html_update
I have a form that accepts comments and adds them to a list without refreshing the page. This is the html: <div id=''aremark''> <%= render :partial => ''comment'' %> </div> <% remote_form_for :comment, :url=>story_comments_path(@story), :html => { :id => ''comment'' } do |form| %> <h5><label
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
2011 Aug 15
2
respond_with with templates and http status when creating an object
Hi. When you use respond_with in a controller #create method and want to render XML the response gets the http status 201 (Created). But if you use a view to render this XML response_with uses the status 200 (Ok), for example when you use the gem rabl. I cannot determine if this matter is related to Rails or rabl. If it''s from Rails, is there a particular reason for this behavior?
2012 Oct 26
1
[LLVMdev] VMKit compilation error
Hi, I have a problem with compiling the new revision, the file Sifsegv_gc makes a call to the file Sigsegv.cpp but returns as file already allocated: ... llvm [3]: Compiling for Debug + Asserts Sigsegv.cpp build (bytecode) llvm [3]: Compiling Sigsegv.ll to Sigsegv.bc for Debug + Asserts build ( bytecode) llvm [3]: Compiling Sigsegv.bc to Sigsegv.s for Debug + Asserts build llvm [3]: Compiling for
2010 Apr 16
1
time_zone_select :priority_zones not working properly
I sent this earlier but I don''t think it ever came through. Sorry if this is a reposting. When using :priority_zones for time_zone_select in a manner described by the API docs for ActionView::Helpers::FormOptionsHelper I''m getting errors. Here is an API docs example: time_zone_select( "user", ''time_zone'', TimeZone.us_zones, :default =>
2008 Feb 05
6
External MWI question for Asterisk
Hey there. I've been working on a project to integrate Asterisk with Exchange Unified Messaging via sipX using large parts borrowed from: http://blog.lithiumblue.com/2007/04/accessing-exchange-2007-unified_29.html ... and everything works surprisingly well. The one problem I have is MWI, or a lack thereof. Exchange 2007 doesn't support MWI of any kind (!), so I've been looking into
2009 Jan 04
3
Missing Template with edge Rails (2.3)
After freezing edge rails, all my controller examples are failing with MissingTemplate errors. e.g., "Missing template attachments/create.erb in view path app/views" Trying to actually render the views gives me the same error. I noticed I can fix most of them by using respond_do but I usually never use it. I almost always only need to respond to one format in one action so I omit
2006 Apr 05
1
number_to_currency inside model
I was wondering if this is possible. I have a model (Item) that contains products. These products have prices that I''d like to format using number_to_currency. Rather than doing this several times inside the view, I thought it might be nice to do it once inside the model. The item table has an field called regular_price which holds a currency amount. I would like to do something
2008 Jun 08
4
Location of ancillary files
Let''s say, for example, that I want to create an order form and that I want to assign an order number to each submitted order form for tracking purposes. So, I create a little file to store the latest number. Then when a new order comes in, I grab that number, increment it by one, assign the incremented number to the order, and finally replace the number that''s in the file with