Displaying 20 results from an estimated 5000 matches similar to: "error when rendering partial from an email template"
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',
2011 Aug 02
1
NoMethodError in Store#index
Thanks in advance
I want to know how to solve No method errors
Agile Rails 4th ed
Great book
But second time I get this type of error
I would like to know how to troubleshoot and resolve
Please see below thanks once again
NoMethodError in Store#index
Showing C:/rails/shop9/app/views/line_items/_line_item.html.erb where
line #9 raised:
undefined method `title'' for nil:NilClass
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
2006 Mar 18
0
AJAX and partial template rendering
I was attempting to integrate a data grid component and ran into a
problem.
I needed to update the <DIV> around my data grid component, however, the
original code did not, so it was using Ajax.Request instead of
Ajax.Updater to do the Ajax call.
I thought that instead of using Ajax.Updater, I could simply leave the
Ajax.Request call, and just do a render (:partial =>
2005 Jul 05
2
root@localhost email problem
I have another problem with the email root at localhost not working now on
centos 3.5 with plesk.
This has always worked in the past. Anytime I test my ecommerce store the
default email address has been root at localhost and has sent an email to my
domain email address when testing. Just recently this has stopped working.
The ecommerce store is php. I contacted the ecommerce store developer
2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in
forms, this is my code
<%= start_form_tag :action => ''create'' %>
<div class="form1">
<table width="auto" boader="8" cellspacing="5" cellpadding="5">
<% hidden_field ''line_item'', ''client_id'', :value
2013 Sep 23
1
redirect on browser success, but redirect on functional test is error
line_items.yml:
one:
product_id: 1
cart_id: 1
quantity: 1
carts.yml:
one: {}
product.rb:
has_many :line_items
cart.rb:
has_many :line_items, dependent: :destroy
line_item.rb:
belongs_to :product
belongs_to :cart
line_item_controller.rb:
def destroy
@line_item = LineItem.find(params[:id])
@cart = @line_item.cart
@line_item.destroy
respond_to do |format|
format.html
2014 May 02
0
What does assign method do in testing ?
*assigns* - _Any objects that are stored as instance variables in
actions for use in views._
(http://guides.rubyonrails.org/testing.html#the-four-hashes-of-the-apocalypse)
I have a code :-
test "should update line_item" do
patch :update, id:@line_item, line_item: {
cart_id:@line_item.cart_id, product_id:@line_item.product_id}
assert_redirected_to
2005 Oct 14
0
Adding extra field in form using ajax causes extra field to be overwritten, any way around that.
I''m having trouble when I try to add another field in the form using ajax.
I''m trying to add another line_item object into the invoice and i''m using
the link_to_remote function to implement this. When I do that though and
submit to the form, the line_item entries all have the same field name so
they get overwritten. I''m not sure how to get around that.
Here is
2017 Aug 28
0
regex - optional part isn't considered in replacement with gsub
"Please, consider that some SKUs have "-"
in the middle, for example: "PG-9021".
Then you need to include these in the list of patterns you gave. Try it
again -- this time with a **complete** list.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his
2006 Jul 01
3
best approach to add form elements dynamically
I am struggling with how to add dynamically add form elements to a form
based on user action. Now here is my situation:
I have model Project that has_many line_items
On the form to create a project I initially display form elements (some
drop downs and text boxes) for adding just one line_item. There is also
a button or a link on the page (not sure if this should be in the main
form or
2017 Aug 27
6
regex - optional part isn't considered in replacement with gsub
Hello, I need some help with regex.
I have this to sentences. I need to extract both "49MU6300" and "LE32S5970"
and put them in a new colum "SKU".
A) SMART TV UHD 49'' CURVO 49MU6300
B) SMART TV HD 32'' LE32S5970
DataFrame for testing:
ecommerce <- data.frame(a = c(1,2), producto = c("SMART TV UHD 49'' CURVO
49MU6300",
2017 Aug 27
0
regex - optional part isn't considered in replacement with gsub
Omar:
I don't think this can work. For example number-letter patterns 4),
5), and 6) would all be matched by pattern 6).
As Jeff indicated, you need to provide the delimiters -- what
characters come before and after the SKU patterns -- to be able to
recognize them. In a quick look at the text file you attached, the
delimiters appeared to be either "-" or " " (blank) and
2006 Feb 16
9
association not inserted automatically.
Hello,
I am trying to write a sample application.
I have
class LineItem< ActiveRecord::Base
belongs_to : order
end
&&
class Order < ActiveRecord::Base
has_one :line_item
end
Now in the controller i am trying :
def add
@ord = Order.new(params[:ord])
@ord.line_item = LineItem.new(params[:lineitem])
if @ord.save
redirect_to :action => ''list''
else
render
2018 Sep 26
1
Which is the best open source ecommerce platform?
Good afternoon from Singapore,
There are far too many choices when it comes to open source ecommerce solutions.
Are there any credible rankings of open source ecommerce platforms?
Which open source ecommerce solution do you think is the best and tell me why.
Thank you.
===BEGIN SIGNATURE===
Turritopsis Dohrnii Teo En Ming's Academic Qualifications as at 30 Oct 2017
[1]
2006 Jan 19
7
validates_numericality_of positive integer
Hi,
What is the simplest way to validate a positive integer?
validates_numericality_of :foo, :integer_only => true
how do I add the positive part? Do I need another validation statement
for pattern matching or do I have to write a validate() funciton for
my model?
Thanks,
Peter
2005 Dec 26
0
[rjs] How can I render a action template instead of partial
Hi,
I want to render a action template with rjs, so instead of doing this:
page.replace_html ''maincontent'', :partial => ''list'' I want to do this:
page.replace_html ''maincontent'', :action => ''list'' but the render (that
is called by replace_html, outputs to the reponds_body), so it doesn''t work.
Is there a
2008 Aug 08
2
template.expect_render fails when partial is rendered from a helper
My spec;
describe ''subnav rendering while logged in'' do
before do
template.stub!(:logged_in?).and_return(true)
template.stub!
(:current_profile).at_least(:once).and_return(mock_profile)
end
def do_render
render "/homepages/show.html.erb"
end
it "should render the logged in partial for homepages" do
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2005 Nov 17
7
render :partial in mail template
Hi,
Is it possible to render a partial template from within a mail template?
I get the following error
undefined method `controller_path'' for SupportMailer:Class
Extracted source (around line #8):
5:
6: <%= @url %>
7:
8: <%= render_partial ''sig_admin'' %>
Jeroen