https://avo.cool logo
Join Discord
Powered by
# avo-2
  • l

    lemon-wall-20836

    08/28/2021, 4:53 PM
    You can set the ‘.destroy’ method to false to dissalow everyone to remove a record
  • l

    lemon-wall-20836

    08/28/2021, 4:53 PM
    Hmm
  • l

    lemon-wall-20836

    08/28/2021, 4:53 PM
    Ok
  • l

    lemon-wall-20836

    08/28/2021, 4:54 PM
    I see
  • b

    brief-king-35906

    08/28/2021, 4:54 PM
    it's a ux thing rather than a permissions thing
  • l

    lemon-wall-20836

    08/28/2021, 4:54 PM
    So only for the ‘Index’ view
  • b

    brief-king-35906

    08/28/2021, 4:54 PM
    erm, only for the table component in the show view
  • l

    lemon-wall-20836

    08/28/2021, 4:55 PM
    For an association
  • b

    brief-king-35906

    08/28/2021, 4:55 PM
    yeah
  • l

    lemon-wall-20836

    08/28/2021, 4:55 PM
    Got it
  • b

    brief-king-35906

    08/28/2021, 4:55 PM
    Entries habtm Tags. I want to hide the delete button for the tags table on an Entry show page, but include it on the Tags index
  • b

    brief-king-35906

    08/28/2021, 4:56 PM
    and the reverse most likely
  • l

    lemon-wall-20836

    08/28/2021, 4:56 PM
    The way we used Hotwire, that is an ‘Index’ view loded inside the ‘Show’ view
  • b

    brief-king-35906

    08/28/2021, 4:56 PM
    which is great 👍
  • b

    brief-king-35906

    08/28/2021, 4:56 PM
    but makes this harder i guess
  • l

    lemon-wall-20836

    08/28/2021, 4:57 PM
    I’m AFK at the moment so can’t give you the exact code, but you should be able, in theory, to deuplicate the ‘ResourceControlsViewComponent’ and add your own conditions inside it
  • l

    lemon-wall-20836

    08/28/2021, 4:58 PM
    Rails should use your version over Avo’s
  • b

    brief-king-35906

    08/28/2021, 4:59 PM
    interesting... thanks for that!
  • l

    lemon-wall-20836

    08/28/2021, 4:59 PM
    And you should be able to check for a @relation object
  • l

    lemon-wall-20836

    08/28/2021, 4:59 PM
    Checking for that code on my phone now
  • l

    lemon-wall-20836

    08/28/2021, 5:00 PM
    Please check this file app/components/avo/index/resource_controls_component.rb
  • l

    lemon-wall-20836

    08/28/2021, 5:01 PM
    And look for the @reflection object
  • b

    brief-king-35906

    08/28/2021, 5:01 PM
    please stop! go enjoy whatever you're doing, this is no rush
  • l

    lemon-wall-20836

    08/28/2021, 5:01 PM
    The reflection should tell you what kind of ‘Index’ view it is. Regular index or nested index
  • l

    lemon-wall-20836

    08/28/2021, 5:01 PM
    No worries
  • l

    lemon-wall-20836

    08/28/2021, 5:01 PM
    It only took a second
  • l

    lemon-wall-20836

    08/28/2021, 5:01 PM
    Glad to be of help
  • b

    brief-king-35906

    08/28/2021, 5:02 PM
    hehe, i appreciate it
  • l

    lemon-wall-20836

    08/28/2021, 5:02 PM
    Plese let me know of I can help some more 😉
  • b

    brief-king-35906

    08/28/2021, 5:03 PM
    oh my that wink emoji is really changing the tone there
1...141516...64Latest