rails routes and custom routing for nested resource
Using your example, you probably should constrain it. Either using the Edition.all.map(&:slug) array you included or cache it in some way depending on how big the list is. This way it will be limited and wouldn't necessarily need to be at the bottom of the routes file.
resources :editions, path: '', :constraints => proc { |req| ['london', 'other_cities'].include?(req.params[:edition_id]) } do
get 'set_session', on: :member
resources :events
resources :quiz_masters
resources :venues
end
How to Format VBA String Split Output Correctly?
The problem that you are having is one of logic. The first "For" loop will run 6 times, each time overwriting "WrdArray()" so that at the end of the loop it is equal to the final value.
The second "For" loop is pasting this final value into 6 different cells.
To fix this, reorder the code:
Sub Break_String()
Dim WrdArray() As String
Dim text_string As String
Dim intCount As Integer, intCounter As Integer
Dim o As Object
Set o = CreateObject("excel.application")
o.Visible = True
o.Workbooks.Open ("NER FTP UPLOADER.xlsm")
For intCount = 1 To 6
text_string = sheets("mySheet").Cells(intCount, 2)
WrdArray() = Split(text_string, "EQ # : ")
o.Sheets("sheet1").Range("B" & (18 + intCount) & ":F" & (18+intCount)).Value = WrdArray()
Next intCount
End Sub
Notice that you also need to change the cells you are pasting to in the loop, otherwise the data will just overwrite.
Alternatively, you could use an array of arrays:
Sub Break_String()
Dim arArrays() As Variant
Dim WrdArray() As String
Dim text_string As String
Dim intCount As Integer, intCounter As Integer
Dim o As Object
ReDim arArrays(1 To 6)
For intCount = 1 To 6
text_string = sheets("mySheet").Cells(intCount, 2)
WrdArray() = Split(text_string, "EQ # : ")
arArrays(intCount) = WrdArray()
Next intCount
Set o = CreateObject("excel.application")
o.Visible = True
o.Workbooks.Open ("NER FTP UPLOADER.xlsm")
For intCount = 1 To 6
o.Sheets("sheet1").Range("B" & (18 + intCount) & ":F" & (18+intCount)).Value = arArrays(intCount)
Next intCount
End Sub
EDIT*** Fixed error in line assigning values from array to the cell. Needed to add ":" to the range. Also changed "24" to "18" as the results should all be on the same row.
While fixing this, noticed that "Cells(intCount, 2)" was not referencing a worksheet. Updated to reference a worksheet, but the correct worksheet name should be added here, not "mySheet."
EDIT2***
Sub Break_String()
Dim WrdArray() As String
Dim text_string As String
Dim intCount As Integer, intCounter As Integer
Dim o As Object
Dim pasteRow As Integer
Dim i As Integer
pasteRow = 19
Set o = CreateObject("excel.application")
o.Visible = True
o.Workbooks.Open ("NER FTP UPLOADER.xlsm")
For intCount = 1 To 6
text_string = sheets("mySheet").Cells(intCount, 2)
WrdArray() = Split(text_string, "EQ # : ")
For i = LBound(WrdArray) to UBound(WrdArray)
o.Sheets("sheet1").Range("B" & (pasteRow)).Value = WrdArray[i]
pasteRow = pasteRow + 1
Next i
Next intCount
End Sub
This will do as asked in the comments.
How to manually switch between more than 2 signals in Simulink
One way to approach this would be to use a Multiport Switch.
This allows you to switch between several outputs based on the value of the first input (which you can tie to a constant block).
This way, when you start a simulation, you can choose the desired input by changing the value of the constant block in your model.
Mathworks Multiport Switch Help
Related Topics
Adding a Directory to the Load Path in Rails
How Can an Activerecord::Relation Object Call Class Methods
How to Validate Exits and Aborts in Rspec
Escaping Single and Double Quotes in a String in Ruby
How to Remove Permission Denied @ Rb_Sysopen - Gem Install Error
Dynamically Set Local Variables in Ruby
Why Do I Get Uninitialized Constant Devise Name Error When Running Webrick Server
Validate Words Against an English Dictionary in Rails
How to Run a Single Rspec Test
Difference Between Has_One and Belongs_To in Rails
Installing Cocoapods: No Response
Ruby String to Date Conversion
Default Task for Namespace in Rake
Rails Resque Workers Fail with Pgerror: Server Closed the Connection Unexpectedly
Unexpected Return (Localjumperror)