我使用form_for helper和Rails 5使用路由命名空间功能,并将其作为模型名称的别名。
我的路线:
edit_customer_profile GET /customer/profile/edit(.:format) customer/profiles#edit
customer_profile PATCH /customer/profile(.:format) customer/profiles#update
PUT /customer/profile(.:format) customer/profiles#update
我的观点:
... omit verbosity ...
<%= form_for [:customer, current_user], as: :profile do |f| %>
... omit verbosity ...
我的错误:
undefined method `customer_user_path' for #<#<Class:0x007f0f8d0ddce0>:0x00558c965b4a78>
使用手中的文档时,表单助手必须使用customer_profile_path
而不是customer_user_path
。
答案 0 :(得分:0)
使用private void setupRecyclerView() {
if(shouldStartSignIn()) return;
if(!PermissionUtils.requestPermission(this, RC_STORAGE_PERMISSION, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
Log.e(TAG, "Permission not granted, don't continue");
return;
}
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
pagesRecyclerView.setLayoutManager(layoutManager);
Query query = FirebaseFirestore.getInstance().collection(Page.COLLECTION).whereEqualTo(Page.FIELD_USER_ID, FirebaseAuth.getInstance().getCurrentUser().getUid()).orderBy(Page.FIELD_TIMESTAMP).limit(50);
FirestoreRecyclerOptions<Page> options = new FirestoreRecyclerOptions.Builder<Page>().setQuery(query, Page.class).build();
adapter = new PagesAdapter(options, this);
pagesRecyclerView.setAdapter(adapter);
}