亲爱的,我正在使用大商业来显示索引上的品牌图像,现在它只显示品牌名称,但我想列出品牌图像,而不是品牌名称,我将如何显示
%%brandFullname%%显示类似的品牌名称有任何其他全局变量显示品牌图像而不是品牌名称
我的代码是
默认页面:
%%Panel.HTMLHead%% <!-- Including the html head -->
%%Panel.Header%% <!-- Includeing the html Header -->
%%Banner.TopBanner%%
%%Panel.SideShopByBrandFull%%
%%
在提交表单时,如下所示在div中呈现"2“。
全品牌/create.js.erb版本1:
$("#brand_ajax").html("1")
$("#brand_ajax").html("0")
$("#brand_ajax").html("2")
部分品牌/Showbrands.html.erb我想刷新的div
<% for brand in @brands%>
ID: <%= h brand.id %>
<% end %>
ajax调用
我想所有的产品应该添加根据品牌,我有一个品牌和产品脚手架,我生成这样的品牌: rails生成脚手架品牌品牌:字符串和生成产品品牌与品牌脚手架关联: rails生成脚手架产品has_many名称:字符串品牌:参考 我的品牌模型 class Brand < ApplicationRecord
has_many :products
end 产品模型 class Product < ApplicationRecord
belongs_to :brand
end 品牌迁移 class CreateBrands < ActiveRecord::Migration[5.2]
我在add.cshtml中有表格。我正在使用razor和@Html.EditFor() helper。
我的viewModel:
public class MerchantViewModel {
// properties
public IEnumerable<AddBrandViewModel> Brands { get; set; }
}
public class AddBrandViewModel {
public string Name { get; set; }
public string Url { get; set; }
我正在用EF创建一个MVC4应用程序,我有两个简单的类,Brand和CarModel,Brand有一个名字(必选)和CarModel有一个品牌(必选)。问题是,我在ModelState.IsValid上得到了一个错误,因为使用下拉菜单来选择一个品牌,它只填写了品牌ID。
如何使离开所需的品牌名称,但能够使用CarModel中的下拉列表?下面是我的代码:
public class Brand
{
public int Id { get; set; }
[Required]
public string Name {
Azure AD B2C位于Azure AD的顶部。Azure AD / Azure AD B2C允许公司品牌。这会影响电子邮件、页面中的标记等。
我们需要在一个Azure AD B2C租户中为两个组织提供不同的品牌体验。我知道我可以用自定义策略中的自定义HTML来改变用户流品牌。但是,这不会影响电子邮件(如密码重置)和登录页面到管理面板。
有人知道在一个Azure AD / Azure AD B2C租户中为两个不同的组织建立品牌的方法吗?
我使用MVC中的模型验证来验证我的表单。
我这样做:
[MetadataType(typeof(CarModel))]
public partial class Car {...}
public class CarModel
{
[Required(ErrorMessage = "Select the brand please")]
[Display(Name = "Brand* :")]
public object brand_id { get; set; }
...
}
在我的视图中,我有以下为下拉列表框编写的代码:
我有一个关于汽车品牌的页面,如果点击一个品牌,我需要被重定向到这个品牌的所有汽车的页面。由于某种原因,我无法访问标签'a‘中所需的内容。
class Marks(models.Model): // MODELS
mark = models.CharField(max_length=64)
def __str__(self):
return self.mark
class Cars(models.Model):
CarName = models.CharField(max_length=64)
mark = models.ForeignKey(
我想隐藏的网页内容的一部分,取决于网址。
现在,如果我输入:
example.co.uk/index.php?brand=apple
然后苹果的内容就会显示出来--但是页面上有一些默认的div,如果没有显示任何品牌,我想隐藏这些div。
我是这样想的:
<?php if brand==""
echo "<!----- comment out all the default HTML"
/>
default html here
<?php if brand==""
echo "-->"
/&
把我的头发扯出来。我有一个品牌模型,这个has_many项目和项目belong_to的品牌。我试图在品牌内部创建项目,但遇到了以下错误:
undefined method `projects_path'
一切似乎都井井有条。我的一些代码可以在下面找到:
路由
resources :brands do
resources :projects do
resources :ideas
end
end
品牌
<%= link_to 'Create New Project', new_brand_project_path(@brand) %&