ฉันสงสัยว่าสิ่งนี้เป็นไปไม่ได้เนื่องจากการควบคุมเวอร์ชัน แต่ฉันสงสัยว่ามีวิธีดูโค้ดในไฟล์ .html.erb โดยตรงหรือไม่ และแก้ไขให้แก้ไขตัวพิมพ์ผิดเล็กน้อย โดยไม่ต้องปรับใช้ทั้งแอปใหม่
ฉันเปิดคอนโซล Heroku แล้วพิมพ์ Dir.chdir "app/views/pages"
นั่นนำฉันไปยังโฟลเดอร์ที่ถูกต้องในไดเร็กทอรี
√ _testApps/[app_name] % heroku console
irb(main):001:0> Dir.chdir "app/views/pages"
=> 0
จากนั้นฉันสามารถดำเนินการ Dir.glob("*.erb")
เพื่อดูรายการไฟล์ทั้งหมดในไดเรกทอรีนั้นที่มีนามสกุลนั้นได้
irb(main):002:0> Dir.glob("*.erb")
=> ["sitemap.html.erb", "about.html.erb", "home.html.erb", "guide.html.erb",
"media_kit.html.erb", "social.html.erb", "terms_of_use.html.erb", "aids.html.erb",
"expectations.html.erb", "faq.html.erb", "privacy_policy.html.erb", "contact_us.html.erb"]
ตอนนี้ สิ่งที่ฉันต้องการทำคือสิ่งที่คุณสามารถทำได้ในการพัฒนาเพื่อเปลี่ยนข้อมูลรับรอง nano rails credentials:edit
แต่การทำ nano rails home.html.erb:edit
หรือ nano rails home:edit
ไม่ได้ผล นี่คือผลลัพธ์พร้อมวิธีต่างๆ ทั้งหมดที่ฉันได้ลอง:
irb(main):003:0> nano rails home.html.erb:edit
Traceback (most recent call last):
1: from (irb):3
NameError (undefined local variable or method `home' for main:Object)
irb(main):004:0> nano rails home:edit
Traceback (most recent call last):
2: from (irb):3
1: from (irb):4:in `rescue in irb_binding'
NameError (undefined local variable or method `edit' for main:Object)
Did you mean? exit
irb(main):005:0> nano home:edit
Traceback (most recent call last):
2: from (irb):4
1: from (irb):5:in `rescue in irb_binding'
NameError (undefined local variable or method `edit' for main:Object)
Did you mean? exit
irb(main):006:0> home:edit
Traceback (most recent call last):
2: from (irb):5
1: from (irb):6:in `rescue in irb_binding'
NoMethodError (undefined method `home' for main:Object)
irb(main):007:0> home.html.erb:edit
Traceback (most recent call last):
2: from (irb):6
1: from (irb):7:in `rescue in irb_binding'
NameError (undefined local variable or method `home' for main:Object)
irb(main):008:0> edit home.html.erb
Traceback (most recent call last):
2: from (irb):7
1: from (irb):8:in `rescue in irb_binding'
NameError (undefined local variable or method `home' for main:Object)
irb(main):009:0> edit home
Traceback (most recent call last):
2: from (irb):8
1: from (irb):9:in `rescue in irb_binding'
NameError (undefined local variable or method `home' for main:Object)
irb(main):010:0> edit "home.html.erb"
Traceback (most recent call last):
2: from (irb):9
1: from (irb):10:in `rescue in irb_binding'
NoMethodError (undefined method `edit' for main:Object)
Did you mean? exit
เป็นไปได้ไหม? หรือเป็นเพราะการควบคุมเวอร์ชันที่ไม่ได้รับอนุญาต และคุณต้องทำในเครื่อง คอมมิตไปที่ git แล้วกด git master เพื่อทำการเปลี่ยนแปลง? สงสัยเพราะคงจะดีถ้าแก้ไขอย่างรวดเร็วโดยไม่ต้องทำตามขั้นตอนอื่นๆ ทั้งหมด และโดยไม่ต้องทำให้เพจเป็นไดนามิกและจัดเก็บข้อมูลลงในตารางเพื่อแก้ไขในเบราว์เซอร์
ขอบคุณสำหรับข้อมูลเชิงลึกของคุณ