Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:08:38+00:00 2026-05-17T22:08:38+00:00

I have a list of users that have requested access to my application. They

  • 0

I have a list of users that have requested access to my application.

They appear in a table inside a view:

<table>
    <thead>
        <th>Company</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Email</th>
        <th>Role</th>
        <th>Action</th>
    </thead>
    <% for ar in @brand.access_requests %>
        <% user = ar.user %>
        <tr id="user_<%= user.id %>">
            <td><%= user.company %></td>
            <td><%= user.first_name %></td>
            <td><%= user.last_name %></td>
            <td><%= user.email %></td>
            <td><%= collection_select :role, :id, Role.all, :id, :name %></td>
            <td><%= link_to "Create", brand_responsibilities_path(@brand), { :remote => true, :method => :post } %></td>
        </tr>
    <% end %>
</table>

So I want to assign a Role to each user, then approve that user.

Obviously this does not work, because I do not know how to refer to the “role_id” field from my link_to.

How do I include a value from another field in my link_to? Is there a way to do a “:with” or something like that? I want to pass whatever is chosen in the select box to:

brand_responsibilities_path(@brand)

I know it would work if I created a form for every single row, but is that overkill, or the Rails Way?
Any help is seriously appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:08:39+00:00Added an answer on May 17, 2026 at 10:08 pm

    I would definitely use the form. The only way that occurs to me to do this using a link is with javascript. Apparently when you do link_to :method => :post, Rails creates a form with javascript!. So I think it’s definitely cleaner to use the form:

    <% form_for user do |f| %>
      <%= f.collection_select :role_id, Role.all, :id, :name %>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that allows users to build a 'client list.' We
I have a list of users in local store that I need to update
I have a list of individual redirects that move users (and google) from abc.site.com/page/name
I have a chat program that displays I list of online users. The message
I have a page which list comments of users. My problem is that I
I have used a list view that uses a grid view in WPF. I
I have a list of questions that the user will iterate through, they can
I have a filemanager application that allows users to upload files to the server
I have a web application that allows anonymous access and windows authentication. Basically, the
I have a project which provides users with a list of current tasks that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.