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 4561462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:04:40+00:00 2026-05-21T18:04:40+00:00

I have a Rails app that uses activescaffold and I would like to hide

  • 0

I have a Rails app that uses activescaffold and I would like to hide some fields on the update for some of the records.

I have been trying to do it using helper methods, but I can not seem to get that to work.

What is the best way to do this?

  • 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-21T18:04:41+00:00Added an answer on May 21, 2026 at 6:04 pm

    The best way to do this is by using one of the security method templates (depending on your need) provided by activescaffold plugin.

    Pasted from activescaffold wiki:

    Model Methods: Restricting Anything
    Else

    On your model object you may define
    methods (none of which accept any
    arguments) in any of four formats,
    depending on your need for
    granularity.

    The formats are:

    * #{column_name}_authorized_for_#{crud_type}?
    

    For example if you have an activescaffold based controller called user:

    class Admin::UsersController < ApplicationController
      active_scaffold do |config|
        config.columns = [:username, :name, :email]
      end
    end
    

    And you only want to allow the user to be able to update the username if they are admin then you can do something like this:

    User Model:

    class User < ActiveRecord::Base
    
      # ActiveScaffold security template: #{column_name}_authorized_for_#{crud_type}?
      def username_authorized_for_update?
        # As soon as this method will return false 
        # the username field will not be available on the update form
        return true # Write logic to decide if username field should be visible
      end
    end
    

    Active Scaffold wiki link: https://github.com/activescaffold/active_scaffold/wiki/Security

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails 3 app that uses a remote/AJAX link to update a
I have a new app (Rails 2.3.8) that uses lots of money fields. I'm
I have a rails app that uses heavily js (over 1MB total). I'd like
I have a ruby on rails app that uses highcharts. Locally it works like
I have a rails app that uses PDFKit to render pdf versions of webpages.
I have a rails 3.2 app that uses 2 databases. One database is the
I have a small Rails 3.2.1 app that uses CarrierWave 0.5.8 for file uploads
I have a rails app that uses partials and in development everything works great
I have a rails app that uses Sunspot and Solr for search functionality. I'm
I have a working rails app that uses imagemagick commands on my local mac

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.